r24947 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24946‎ | r24947 | r24948 >
Date:13:43, 20 August 2007
Author:brion
Status:old
Tags:
Comment:
Throw an exception for invalid data in expandAttributes() so we get a backtrace and can beat the shit out of whoever did us wrong instead of just seeing a useless PHP warning message or worse yet silently going through without even knowing we probably lost the data we wanted somewhere else in our output
Modified paths:
  • /trunk/phase3/includes/Xml.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Xml.php
@@ -45,6 +45,8 @@
4646 if( is_array( $attribs ) ) {
4747 foreach( $attribs as $name => $val )
4848 $out .= " {$name}=\"" . Sanitizer::encodeAttribute( $val ) . '"';
 49+ } else {
 50+ throw new MWException( 'Expected attribute array, got something else in ' . __METHOD__ );
4951 }
5052 return $out;
5153 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r25016Merged revisions 24866-25015 via svnmerge from...david23:06, 21 August 2007

Status & tagging log