r51487 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51486‎ | r51487 | r51488 >
Date:03:29, 5 June 2009
Author:laner
Status:deferred
Tags:
Comment:
* Fix encoding problem for data, preprocessor arguments, and arguments
* Fix problem with preprocessor arguments
** Preprocessor scripts can be called without defining arguments
** Preprocessor scripts can be called with a mismatched number of arguments
** Preprocessor scripts can be called with blank arguments (like preprocessorarguments=0,3::1,2 )
Modified paths:
  • /trunk/extensions/Plotters/Plotters.php (modified) (history)
  • /trunk/extensions/Plotters/PlottersParser.php (modified) (history)
  • /trunk/extensions/Plotters/libs/fixencoding.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Plotters/PlottersParser.php
@@ -66,6 +66,16 @@
6767 $this->argumentArray["preprocessorarguments"][] = $subargumentarr;
6868 }
6969 }
 70+
 71+ // If there are less preprocessorarguments than preprocessors, we want to ensure that we
 72+ // have enough arrays, as later code will expect an array to exist for each preprocessor
 73+ $preproccount = count( $this->argumentArray["preprocessors"] );
 74+ $preprocargcount = count( $this->argumentArray["preprocessorarguments"] );
 75+ if ( $preproccount > $preprocargcount ) {
 76+ for ( $i = $preprocargcount; $i < $preproccount; $i++ ) {
 77+ $this->argumentArray["preprocessorarguments"][] = array();
 78+ }
 79+ }
7080 }
7181 if ( isset( $argv["script"] ) ) {
7282 // Sanitize scripts - alphanumerics only
Index: trunk/extensions/Plotters/Plotters.php
@@ -27,7 +27,7 @@
2828 $wgExtensionCredits['other'][] = array(
2929 'path' => __FILE__,
3030 'name' => 'Plotter parser extension',
31 - 'version' => '0.3a',
 31+ 'version' => '0.4a',
3232 'author' => 'Ryan Lane',
3333 'description' => 'Allows users to create client side graphs and plots',
3434 'descriptionmsg' => 'plotters-desc',
Index: trunk/extensions/Plotters/libs/fixencoding.js
@@ -233,6 +233,6 @@
234234
235235 function fix_encoding_array( arr ) {
236236 for ( var i = 0; i < arr.length; ++i ) {
237 - arr[i] = fix_encoding( arr[i] );
 237+ fix_encoding( arr[i] );
238238 }
239239 }

Status & tagging log