r53690 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53689‎ | r53690 | r53691 >
Date:18:02, 23 July 2009
Author:yaron
Status:deferred
Tags:
Comment:
Changed 'float' type description to 'number', added HTML-escaping for textareas
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormInputs.inc (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormInputs.inc
@@ -73,9 +73,9 @@
7474 if ($other_args['field_type'] == 'integer') {
7575 $size = 10;
7676 $validation_type_str = 'integer';
77 - } elseif ($other_args['field_type'] == 'float') {
 77+ } elseif ($other_args['field_type'] == 'number') {
7878 $size = 10;
79 - $validation_type_str = 'float';
 79+ $validation_type_str = 'number';
8080 } elseif ($other_args['field_type'] == 'URL') {
8181 $size = 100;
8282 $validation_type_str = 'URL';
@@ -95,7 +95,8 @@
9696 } else {
9797 $size = 35;
9898 }
99 - $cur_value = htmlspecialchars($cur_value);
 99+ if (! is_null($cur_value))
 100+ $cur_value = htmlspecialchars($cur_value);
100101
101102 $text =<<<END
102103 <input id="$input_id" tabindex="$sfgTabIndex" class="$className" name="$input_name" type="text"
@@ -413,6 +414,7 @@
414415 $js_call = "";
415416 }
416417
 418+ $cur_value = htmlspecialchars($cur_value);
417419 $text =<<<END
418420 <textarea tabindex="$sfgTabIndex" id="$input_id" name="$input_name" rows="$rows" cols="$cols" class="$className" $disabled_text $js_call>$cur_value</textarea>
419421 <span id="$info_id" class="errorMessage"></span>

Status & tagging log