r78189 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78188‎ | r78189 | r78190 >
Date:14:45, 10 December 2010
Author:yaron
Status:deferred
Tags:
Comment:
Added some more newlines to HTML display, fixed handling of category names containing ampersands and other special characters in 'category' and 'categories' inputs
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_FormInputs.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_FormInputs.php
@@ -352,7 +352,7 @@
353353 }
354354 }
355355
356 - $text .= "\t" . Xml::hidden( $input_name . '[is_list]', 1 ) . "\n";
 356+ $text .= "\n" . Xml::hidden( $input_name . '[is_list]', 1 ) . "\n";
357357 $outerSpanAttrs = array( 'id' => $outerSpanID, 'class' => $outerSpanClass );
358358 $text = "\t" . Xml::tags( 'span', $outerSpanAttrs, $text ) . "\n";
359359
@@ -519,7 +519,7 @@
520520 if ( array_key_exists( 'maxlength', $other_args ) ) {
521521 $text .= ' maxlength="' . $other_args['maxlength'] . '"';
522522 }
523 - $text = "\t" . Xml::element( 'input', $inputAttrs ) . "\n";
 523+ $text = "\n\t" . Xml::element( 'input', $inputAttrs ) . "\n";
524524 }
525525 // is_list and delimiter variables - needed later
526526 $is_list = ( array_key_exists( 'is_list', $other_args ) && $other_args['is_list'] == true );
@@ -543,7 +543,7 @@
544544
545545 $spanClass = "inputSpan";
546546 if ( $is_mandatory ) { $spanClass .= " mandatoryFieldSpan"; }
547 - $text = Xml::tags( 'span', array( 'class' => $spanClass ), $text );
 547+ $text = "\n" . Xml::tags( 'span', array( 'class' => $spanClass ), $text );
548548
549549 $options_str_key = $autocompletion_source;
550550 if ( $is_list ) {
@@ -960,6 +960,8 @@
961961 $wgCategoryTreeMaxDepth = 10;
962962 $tree = efCategoryTreeParserHook( $top_category, array( 'mode' => 'categories', 'depth' => 10 ) );
963963
 964+ // CategoryTree HTML-escapes all values
 965+ $cur_value = htmlentities( $cur_value );
964966 // capitalize the first letter, if first letters always get capitalized
965967 global $wgCapitalLinks;
966968 if ( $wgCapitalLinks ) {
@@ -1035,6 +1037,8 @@
10361038 }
10371039 // set all checkboxes matching $cur_values to checked
10381040 foreach ( $cur_values as $value ) {
 1041+ // CategoryTree HTML-escapes all values
 1042+ $value = htmlentities( $value );
10391043 // capitalize the first letter, if first letters always get capitalized
10401044 if ( $wgCapitalLinks ) {
10411045 global $wgContLang;
@@ -1052,7 +1056,7 @@
10531057 $text .= "\t" . Xml::hidden( $input_name . '[is_list]', 1 ) . "\n";
10541058 $spanClass = "checkboxesSpan";
10551059 if ( $is_mandatory) { $spanClass .= " mandatoryFieldSpan"; }
1056 - $text = "\t" . Xml::tags( 'span', array( 'class' => $spanClass ), $text ) . "\n";
 1060+ $text = "\n" . Xml::tags( 'span', array( 'class' => $spanClass ), $text ) . "\n";
10571061
10581062 return $text;
10591063 }

Status & tagging log