r100755 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100754‎ | r100755 | r100756 >
Date:22:15, 25 October 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
REL1_16 MFT r97887, r100573, r100689, r100692
Modified paths:
  • /branches/REL1_18/extensions (modified) (history)
  • /branches/REL1_18/extensions/AbuseFilter/AbuseFilter.hooks.php (modified) (history)
  • /branches/REL1_18/extensions/CheckUser/maintenance/purgeOldData.php (modified) (history)
  • /branches/REL1_18/extensions/Gadgets/Gadgets_body.php (modified) (history)
  • /branches/REL1_18/extensions/Ratings/Ratings.php (modified) (history)

Diff [purge]

Index: branches/REL1_18/extensions/Gadgets/Gadgets_body.php
@@ -16,7 +16,7 @@
1717
1818 /**
1919 * ArticleSaveComplete hook handler.
20 - *
 20+ *
2121 * @param $article Article
2222 * @param $user User
2323 * @param $text String: New page text
@@ -56,7 +56,7 @@
5757 public static function getPreferences( $user, &$preferences ) {
5858 $gadgets = Gadget::loadStructuredList();
5959 if (!$gadgets) return true;
60 -
 60+
6161 $options = array();
6262 $default = array();
6363 foreach( $gadgets as $section => $thisSection ) {
@@ -79,7 +79,7 @@
8080 $options = array_merge( $options, $available );
8181 }
8282 }
83 -
 83+
8484 $preferences['gadgets-intro'] =
8585 array(
8686 'type' => 'info',
@@ -91,8 +91,8 @@
9292 'raw' => 1,
9393 'rawrow' => 1,
9494 );
95 -
96 - $preferences['gadgets'] =
 95+
 96+ $preferences['gadgets'] =
9797 array(
9898 'type' => 'multiselect',
9999 'options' => $options,
@@ -101,7 +101,7 @@
102102 'prefix' => 'gadget-',
103103 'default' => $default,
104104 );
105 -
 105+
106106 return true;
107107 }
108108
@@ -129,7 +129,7 @@
130130 */
131131 public static function beforePageDisplay( $out ) {
132132 global $wgUser;
133 -
 133+
134134 wfProfileIn( __METHOD__ );
135135
136136 $gadgets = Gadget::loadList();
@@ -169,7 +169,7 @@
170170
171171 /**
172172 * Adds one legacy script to output.
173 - *
 173+ *
174174 * @param $page String: Unprefixed page title
175175 * @param $out OutputPage
176176 */
@@ -354,8 +354,8 @@
355355 * @return Boolean: Whether this gadget has resources that can be loaded via ResourceLoader
356356 */
357357 public function hasModule() {
358 - return count( $this->styles )
359 - + ( $this->supportsResourceLoader() ? count( $this->scripts ) : 0 )
 358+ return count( $this->styles )
 359+ + ( $this->supportsResourceLoader() ? count( $this->scripts ) : 0 )
360360 > 0;
361361 }
362362
@@ -506,12 +506,13 @@
507507 return $gadgets;
508508 }
509509
510 - $g = wfMsgForContentNoTrans( "gadgets-definition" );
511 - if ( wfEmptyMsg( "gadgets-definition", $g ) ) {
 510+ $g = wfMessage( "gadgets-definition" )->inContentLanguage();
 511+ if ( !$g->exists() ) {
512512 $gadgets = false;
513513 wfProfileOut( __METHOD__ );
514514 return $gadgets;
515515 }
 516+ $g = $g->plain();
516517 } else {
517518 $g = $forceNewText;
518519 }
Property changes on: branches/REL1_18/extensions/Gadgets/Gadgets_body.php
___________________________________________________________________
Modified: svn:mergeinfo
519520 Merged /trunk/extensions/Gadgets/Gadgets_body.php:r97887,100573,100689,100692
Index: branches/REL1_18/extensions/CheckUser/maintenance/purgeOldData.php
@@ -46,9 +46,9 @@
4747 break; // all cleared
4848 }
4949 // Record the start and end timestamp for the set
50 - $blockStart = $res->fetchObject()->$ts_column;
 50+ $blockStart = $dbw->addQuotes( $res->fetchObject()->$ts_column );
5151 $res->seek( $res->numRows() - 1 );
52 - $blockEnd = $res->fetchObject()->$ts_column;
 52+ $blockEnd = $dbw->addQuotes( $res->fetchObject()->$ts_column );
5353 $res->free();
5454
5555 // Do the actual delete...
Index: branches/REL1_18/extensions/Ratings/Ratings.php
@@ -35,7 +35,7 @@
3636
3737 // Only initialize the extension when all dependencies are present.
3838 if ( ! defined( 'Validator_VERSION' ) ) {
39 - die( '<b>Error:</b> You need to have <a href="http://www.mediawiki.org/wiki/Extension:Validator">Validator</a> installed in order to use <a href="http://www.mediawiki.org/wiki/Extension:SubPageList">SubPageList</a>.<br />' );
 39+ die( '<b>Error:</b> You need to have <a href="http://www.mediawiki.org/wiki/Extension:Validator">Validator</a> installed in order to use <a href="http://www.mediawiki.org/wiki/Extension:Ratings">Ratings</a>.<br />' );
4040 }
4141
4242 define( 'Ratings_VERSION', '0.1 alpha' );
Index: branches/REL1_18/extensions/AbuseFilter/AbuseFilter.hooks.php
@@ -10,18 +10,19 @@
1111 // Load vars
1212 $vars = new AbuseFilterVariableHolder;
1313
14 - // Cache article object so we can share a parse operation
15 - $title = $editor->mTitle;
16 - $articleCacheKey = $title->getNamespace() . ':' . $title->getText();
17 - AFComputedVariable::$articleCache[$articleCacheKey] = $editor->mArticle;
18 -
1914 // Check for null edits.
2015 $oldtext = '';
2116
2217 if ( $editor->mArticle->exists() ) {
23 - $oldtext = $editor->mArticle->getContent();
 18+ // Make sure we load the latest text saved in database (bug 31656)
 19+ $oldtext = $editor->mArticle->getRevision()->getRawText();
2420 }
2521
 22+ // Cache article object so we can share a parse operation
 23+ $title = $editor->mTitle;
 24+ $articleCacheKey = $title->getNamespace() . ':' . $title->getText();
 25+ AFComputedVariable::$articleCache[$articleCacheKey] = $editor->mArticle;
 26+
2627 if ( strcmp( $oldtext, $text ) == 0 ) {
2728 // Don't trigger for null edits.
2829 return true;
Property changes on: branches/REL1_18/extensions
___________________________________________________________________
Modified: svn:mergeinfo
2930 Merged /trunk/extensions:r97887,100573,100689,100692

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r97887Replaced use of wfEmptyMsg() with new Message class. The underlying implement...aaron05:43, 23 September 2011
r100573Added quotes to $blockStart/$blockEndaaron02:26, 24 October 2011
r100689Fix extension nameraymond11:52, 25 October 2011
r100692(bug 31656) AbuseFilter skips non null edits...hashar12:46, 25 October 2011

Comments

#Comment by G.Hagedorn (talk | contribs)   22:20, 25 October 2011

Comment should be 1.18, not 1.16

Status & tagging log