r104826 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104825‎ | r104826 | r104827 >
Date:01:51, 1 December 2011
Author:yaron
Status:deferred (Comments)
Tags:
Comment:
Fix for PHP bug
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_PageSchemas.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_PageSchemas.php
@@ -142,8 +142,8 @@
143143 foreach ( $key_values_array as $i => $value ) {
144144 // replace beep back with comma, trim
145145 $value = str_replace( "\a", $listSeparator, trim( $value ) );
146 - $param_value = explode( "=", $value );
147 - if ( $param_value[1] != null ) {
 146+ $param_value = explode( "=", $value, 2 );
 147+ if ( count( $param_value ) == 2 && $param_value[1] != null ) {
148148 // Handles <Parameter name="size">20</Parameter>
149149 $xml .= '<Parameter name="'.$param_value[0].'">'.$param_value[1].'</Parameter>';
150150 } else {

Comments

#Comment by Nikerabbit (talk | contribs)   09:03, 2 December 2011

What bug? It's probably a documented behavior.

#Comment by Yaron Koren (talk | contribs)   18:11, 5 December 2011

Sorry, I should have phrased that better - I didn't mean "a bug in PHP", I meant a bug that's specific to PHP - trying to retrieve the value for an unassigned index.