r91965 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91964‎ | r91965 | r91966 >
Date:14:32, 12 July 2011
Author:ialex
Status:ok (Comments)
Tags:
Comment:
Preprocess the text in the current Parser instance instead of creating a new one
Modified paths:
  • /trunk/extensions/RandomImageByCategory/RandomImageByCategory.php (modified) (history)

Diff [purge]

Index: trunk/extensions/RandomImageByCategory/RandomImageByCategory.php
@@ -35,7 +35,7 @@
3636 }
3737
3838 function getRandomImage( $input, $args, $parser ) {
39 - global $wgOut, $wgMemc;
 39+ global $wgMemc;
4040
4141 wfProfileIn( __METHOD__ );
4242
@@ -60,8 +60,8 @@
6161 $image_list = array();
6262 if( !$data ) {
6363 wfDebug( "Getting random image list from DB\n" );
64 - $p = new Parser();
65 - $ctg = $p->transformMsg( $categories, $wgOut->parserOptions() );
 64+ $ctg = $parser->replaceVariables( $categories );
 65+ $ctg = $parser->mStripState->unstripBoth( $ctg );
6666 $ctg = str_replace( "\,", '#comma#', $ctg );
6767 $aCat = explode( ',', $ctg );
6868
@@ -99,7 +99,7 @@
100100 $image_list = $data;
101101 wfDebug( "Cache hit for random image list\n" );
102102 }
103 -
 103+var_dump( $image_list );
104104 $random_image = '';
105105 $thumbnail = '';
106106 if( count( $image_list ) > 1 ) {
@@ -117,4 +117,4 @@
118118 wfProfileOut( __METHOD__ );
119119
120120 return $thumbnail;
121 -}
\ No newline at end of file
 121+}

Follow-up revisions

RevisionCommit summaryAuthorDate
r91971Seems I forgot to save before commiting r91965 (thanks Jack Phoenix)ialex15:48, 12 July 2011

Comments

#Comment by Jack Phoenix (talk | contribs)   14:45, 12 July 2011
+var_dump( $image_list );

Whoops :)

Status & tagging log