http://www.mediawiki.org/wiki/Special:Code/MediaWiki/60808

Revision: 60808
Author:   yaron
Date:     2010-01-07 21:31:33 +0000 (Thu, 07 Jan 2010)

Log Message:
-----------
Added more checking for 'value_labels'

Modified Paths:
--------------
    trunk/extensions/SemanticForms/includes/SF_FormInputs.inc

Modified: trunk/extensions/SemanticForms/includes/SF_FormInputs.inc
===================================================================
--- trunk/extensions/SemanticForms/includes/SF_FormInputs.inc   2010-01-07 
20:52:44 UTC (rev 60807)
+++ trunk/extensions/SemanticForms/includes/SF_FormInputs.inc   2010-01-07 
21:31:33 UTC (rev 60808)
@@ -160,7 +160,7 @@
       $text .= "  <option value=\"$possible_value\"";
       if ($possible_value == $cur_value) {$text .= " selected=\"selected\""; }
       $text .= ">";
-      if (array_key_exists('value_labels', $other_args) && 
array_key_exists($possible_value, $other_args['value_labels']))
+      if (array_key_exists('value_labels', $other_args) && 
is_array($other_args['value_labels']) && array_key_exists($possible_value, 
$other_args['value_labels']))
        $text .= htmlspecialchars($other_args['value_labels'][$possible_value]);
       else
        $text .= $possible_value;
@@ -220,7 +220,7 @@
       $text .= "  <option value=\"$possible_value\"";
       if (in_array($possible_value, $cur_values)) {$text .= " selected"; }
       $text .= ">";
-      if (array_key_exists('value_labels', $other_args) && 
array_key_exists($possible_value, $other_args['value_labels']))
+      if (array_key_exists('value_labels', $other_args) && 
is_array($other_args['value_labels']) && array_key_exists($possible_value, 
$other_args['value_labels']))
        $text .= htmlspecialchars($other_args['value_labels'][$possible_value]);
       else
        $text .= $possible_value;
@@ -264,7 +264,7 @@
     foreach ($possible_values as $key => $possible_value) {
       $cur_input_name = $input_name . "[" . $key . "]";
       $checked_text = (in_array($possible_value, $cur_values)) ? 
'checked="checked"' : "";
-      if (array_key_exists('value_labels', $other_args) && 
array_key_exists($possible_value, $other_args['value_labels']))
+      if (array_key_exists('value_labels', $other_args) && 
is_array($other_args['value_labels']) && array_key_exists($possible_value, 
$other_args['value_labels']))
        $label = htmlspecialchars($other_args['value_labels'][$possible_value]);
       else
        $label = $possible_value;
@@ -613,7 +613,7 @@
         $text .= ' checked="checked"';
         $check_set = true;
       }
-      if (array_key_exists('value_labels', $other_args) && 
array_key_exists($possible_value, $other_args['value_labels']))
+      if (array_key_exists('value_labels', $other_args) && 
is_array($other_args['value_labels']) && array_key_exists($possible_value, 
$other_args['value_labels']))
        $label = htmlspecialchars($other_args['value_labels'][$possible_value]);
       else
        $label = $possible_value;



_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to