r68890 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68889‎ | r68890 | r68891 >
Date:16:41, 2 July 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Changes for 0.3.4 - fixed escaping issue
Modified paths:
  • /trunk/extensions/Validator/Validator.class.php (modified) (history)
  • /trunk/extensions/Validator/Validator.php (modified) (history)
  • /trunk/extensions/Validator/Validator_Manager.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Validator/Validator.class.php
@@ -208,7 +208,7 @@
209209 */
210210 public function setParameters( array $parameters, array $parameterInfo, $toLower = true ) {
211211 $this->mParameterInfo = $parameterInfo;
212 -
 212+
213213 // Loop through all the user provided parameters, and destinguise between those that are allowed and those that are not.
214214 foreach ( $parameters as $paramName => $paramData ) {
215215 $paramName = trim( strtolower( $paramName ) );
Index: trunk/extensions/Validator/Validator_Manager.php
@@ -97,7 +97,7 @@
9898 $errorList = '<b>' . wfMsgExt( 'validator_error_parameters', 'parsemag', count( $rawErrors ) ) . '</b><br /><i>';
9999
100100 $errors = array();
101 -
 101+
102102 foreach ( $rawErrors as $error ) {
103103 $error['name'] = '<b>' . Sanitizer::escapeId( $error['name'] ) . '</b>';
104104
@@ -158,7 +158,7 @@
159159 $errors[] = wfMsgExt( 'validator_error_accepts_only', array( 'parsemag' ), $error['name'], $itemsText, count( $error['args'] ) );
160160 break;
161161 case 'invalid' : default :
162 - $errors[] = wfMsgExt( 'validator_error_invalid_argument', array( 'parsemag' ), '<b>' . Sanitizer::escapeId( $error['value'] ) . '</b>', $error['name'] );
 162+ $errors[] = wfMsgExt( 'validator_error_invalid_argument', array( 'parsemag' ), '<b>' . htmlspecialchars( $error['value'] ) . '</b>', $error['name'] );
163163 break;
164164 }
165165 }
Index: trunk/extensions/Validator/Validator.php
@@ -24,7 +24,7 @@
2525 die( 'Not an entry point.' );
2626 }
2727
28 -define( 'Validator_VERSION', '0.3.4 a3' );
 28+define( 'Validator_VERSION', '0.3.4 a5' );
2929
3030 // Constants indicating the strictness of the parameter validation.
3131 define( 'Validator_ERRORS_NONE', 0 );

Status & tagging log