r65632 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65631‎ | r65632 | r65633 >
Date:19:58, 28 April 2010
Author:yaron
Status:deferred
Tags:
Comment:
Added sorting to getAllPagesForCategory(), added 'static' declaration to static function
Modified paths:
  • /trunk/extensions/SemanticForms/includes/SF_Utils.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticForms/includes/SF_Utils.php
@@ -284,8 +284,10 @@
285285 $pages[] = array( 'title' => $cur_value );
286286 }
287287 // return if we've reached the maximum number of allowed values
288 - if ( count( $pages ) > $sfgMaxAutocompleteValues )
 288+ if ( count( $pages ) > $sfgMaxAutocompleteValues ) {
 289+ sort( $pages );
289290 return $pages;
 291+ }
290292 }
291293 }
292294 }
@@ -293,12 +295,14 @@
294296 }
295297 }
296298 if ( count( $newcategories ) == 0 ) {
 299+ sort( $pages );
297300 return $pages;
298301 } else {
299302 $categories = array_merge( $categories, $newcategories );
300303 }
301304 $checkcategories = array_diff( $newcategories, array() );
302305 }
 306+ sort( $pages );
303307 return $pages;
304308 }
305309
@@ -388,7 +392,7 @@
389393 * Parse the form definition and store the resulting HTML in the
390394 * page_props table, if caching has been specified in LocalSettings.php
391395 */
392 - function cacheFormDefinition( $parser, $text ) {
 396+ static function cacheFormDefinition( $parser, $text ) {
393397 global $sfgCacheFormDefinitions;
394398 if ( ! $sfgCacheFormDefinitions )
395399 return true;

Status & tagging log