Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -72,10 +72,10 @@ |
73 | 73 | $wgFlaggedRevsLowProfile = true; |
74 | 74 | |
75 | 75 | # Allowed namespaces of reviewable pages |
76 | | -$wgFlaggedRevsNamespaces = array( NS_MAIN, NS_IMAGE, NS_TEMPLATE ); |
| 76 | +$wgFlaggedRevsNamespaces = array( NS_MAIN, NS_FILE, NS_TEMPLATE ); |
77 | 77 | # Patrollable namespaces (overridden by reviewable namespaces) |
78 | 78 | $wgFlaggedRevsPatrolNamespaces = array(); |
79 | | -#$wgFlaggedRevsPatrolNamespaces = array( NS_CATEGORY, NS_IMAGE, NS_TEMPLATE ); |
| 79 | +#$wgFlaggedRevsPatrolNamespaces = array( NS_CATEGORY, NS_FILE, NS_TEMPLATE ); |
80 | 80 | |
81 | 81 | # Pages exempt from reviewing |
82 | 82 | $wgFlaggedRevsWhitelist = array(); |
Index: trunk/extensions/FlaggedRevs/FlaggedArticle.php |
— | — | @@ -1041,7 +1041,7 @@ |
1042 | 1042 | array( 'fi_rev_id' => $frev->getRevId() ), |
1043 | 1043 | __METHOD__, |
1044 | 1044 | array(), /* OPTIONS */ |
1045 | | - array( 'page' => array('LEFT JOIN','page_namespace = '. NS_IMAGE .' AND page_title = fi_name'), |
| 1045 | + array( 'page' => array('LEFT JOIN','page_namespace = '. NS_FILE .' AND page_title = fi_name'), |
1046 | 1046 | 'image' => array('LEFT JOIN','img_name = fi_name'), |
1047 | 1047 | 'flaggedpages' => array('LEFT JOIN','fp_page_id = page_id'), |
1048 | 1048 | 'flaggedrevs' => array('LEFT JOIN','fr_page_id = fp_page_id AND fr_rev_id = fp_stable') ) |
— | — | @@ -1055,7 +1055,7 @@ |
1056 | 1056 | } |
1057 | 1057 | $imgChanges = array(); |
1058 | 1058 | while( $row = $dbr->fetchObject( $ret ) ) { |
1059 | | - $title = Title::makeTitle( NS_IMAGE, $row->fi_name ); |
| 1059 | + $title = Title::makeTitle( NS_FILE, $row->fi_name ); |
1060 | 1060 | // stable time -> time when reviewed (unless the other is newer) |
1061 | 1061 | $timestamp = isset($row->fr_img_timestamp) && $row->fr_img_timestamp >= $row->fi_img_timestamp ? |
1062 | 1062 | $row->fr_img_timestamp : $row->fi_img_timestamp; |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php |
— | — | @@ -475,7 +475,7 @@ |
476 | 476 | public static function getFileVersionFromCache( $revId, $dbKey ) { |
477 | 477 | self::load(); |
478 | 478 | if( isset(self::$includeVersionCache[$revId]) ) { |
479 | | - # All NS_IMAGE, no need to check namespace |
| 479 | + # All NS_FILE, no need to check namespace |
480 | 480 | if( isset(self::$includeVersionCache[$revId]['files'][$dbKey]) ) { |
481 | 481 | $time_SHA1 = self::$includeVersionCache[$revId]['files'][$dbKey]; |
482 | 482 | foreach( $time_SHA1 as $time => $sha1 ) { |
— | — | @@ -876,8 +876,8 @@ |
877 | 877 | */ |
878 | 878 | public static function isPageReviewable( $title ) { |
879 | 879 | global $wgFlaggedRevsNamespaces, $wgFlaggedRevsWhitelist; |
880 | | - # FIXME: Treat NS_MEDIA as NS_IMAGE |
881 | | - $ns = ( $title->getNamespace() == NS_MEDIA ) ? NS_IMAGE : $title->getNamespace(); |
| 880 | + # FIXME: Treat NS_MEDIA as NS_FILE |
| 881 | + $ns = ( $title->getNamespace() == NS_MEDIA ) ? NS_FILE : $title->getNamespace(); |
882 | 882 | # Check for MW: pages and whitelist for exempt pages |
883 | 883 | if( $ns == NS_MEDIAWIKI || in_array( $title->getPrefixedDBKey(), $wgFlaggedRevsWhitelist ) ) { |
884 | 884 | return false; |
— | — | @@ -892,8 +892,8 @@ |
893 | 893 | */ |
894 | 894 | public static function isPageRateable( $title ) { |
895 | 895 | global $wgFeedbackNamespaces, $wgFlaggedRevsWhitelist; |
896 | | - # FIXME: Treat NS_MEDIA as NS_IMAGE |
897 | | - $ns = ( $title->getNamespace() == NS_MEDIA ) ? NS_IMAGE : $title->getNamespace(); |
| 896 | + # FIXME: Treat NS_MEDIA as NS_FILE |
| 897 | + $ns = ( $title->getNamespace() == NS_MEDIA ) ? NS_FILE : $title->getNamespace(); |
898 | 898 | # Check for MW: pages and whitelist for exempt pages |
899 | 899 | if( $ns == NS_MEDIAWIKI || in_array( $title->getPrefixedDBKey(), $wgFlaggedRevsWhitelist ) ) { |
900 | 900 | return false; |
— | — | @@ -912,8 +912,8 @@ |
913 | 913 | if( self::isPageReviewable($title) ) { |
914 | 914 | return false; |
915 | 915 | } |
916 | | - # FIXME: Treat NS_MEDIA as NS_IMAGE |
917 | | - $ns = ( $title->getNamespace() == NS_MEDIA ) ? NS_IMAGE : $title->getNamespace(); |
| 916 | + # FIXME: Treat NS_MEDIA as NS_FILE |
| 917 | + $ns = ( $title->getNamespace() == NS_MEDIA ) ? NS_FILE : $title->getNamespace(); |
918 | 918 | return ( in_array($ns,$wgFlaggedRevsPatrolNamespaces) && !$title->isTalkPage() ); |
919 | 919 | } |
920 | 920 | |
— | — | @@ -1053,7 +1053,7 @@ |
1054 | 1054 | |
1055 | 1055 | # If this is an image page, store corresponding file info |
1056 | 1056 | $fileData = array(); |
1057 | | - if( $title->getNamespace() == NS_IMAGE && $file = wfFindFile($title) ) { |
| 1057 | + if( $title->getNamespace() == NS_FILE && ($file = wfFindFile($title)) ) { |
1058 | 1058 | $fileData['name'] = $title->getDBkey(); |
1059 | 1059 | $fileData['timestamp'] = $file->getTimestamp(); |
1060 | 1060 | $fileData['sha1'] = $file->getSha1(); |
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -200,7 +200,7 @@ |
201 | 201 | } |
202 | 202 | foreach( $parserOut->getImages() as $image => $n ) { |
203 | 203 | if( !isset($linksUpdate->mImages[$image]) ) { |
204 | | - self::addLink( $links, NS_IMAGE, $image ); |
| 204 | + self::addLink( $links, NS_FILE, $image ); |
205 | 205 | } |
206 | 206 | } |
207 | 207 | foreach( $parserOut->getTemplates() as $ns => $titles ) { |
— | — | @@ -374,8 +374,8 @@ |
375 | 375 | } |
376 | 376 | $file = null; |
377 | 377 | $dbr = wfGetDB( DB_SLAVE ); |
378 | | - # Normalize NS_MEDIA to NS_IMAGE |
379 | | - $title = $nt->getNamespace() == NS_IMAGE ? $nt : Title::makeTitle( NS_IMAGE, $nt->getDBKey() ); |
| 378 | + # Normalize NS_MEDIA to NS_FILE |
| 379 | + $title = $nt->getNamespace() == NS_FILE ? $nt : Title::makeTitle( NS_FILE, $nt->getDBKey() ); |
380 | 380 | # Check for stable version of image if this feature is enabled. |
381 | 381 | # Should be in reviewable namespace, this saves unneeded DB checks as |
382 | 382 | # well as enforce site settings if they are later changed. |
— | — | @@ -442,7 +442,7 @@ |
443 | 443 | */ |
444 | 444 | public static function galleryFindStableFileTime( $ig, $nt, &$time, &$query=false ) { |
445 | 445 | # Trigger for stable version parsing only |
446 | | - if( empty($ig->mParser->fr_isStable) || $nt->getNamespace() != NS_IMAGE ) { |
| 446 | + if( empty($ig->mParser->fr_isStable) || $nt->getNamespace() != NS_FILE ) { |
447 | 447 | return true; |
448 | 448 | } |
449 | 449 | $file = null; |
— | — | @@ -535,7 +535,7 @@ |
536 | 536 | if( !empty($parser->mOutput->mImages) ) { |
537 | 537 | foreach( $parser->mOutput->mImages as $filename => $x ) { |
538 | 538 | # FIXME: it would be nice not to double fetch these! |
539 | | - $file = wfFindFile( Title::makeTitleSafe( NS_IMAGE, $filename ) ); |
| 539 | + $file = wfFindFile( Title::makeTitleSafe( NS_FILE, $filename ) ); |
540 | 540 | $parser->mOutput->fr_ImageSHA1Keys[$filename] = array(); |
541 | 541 | if( $file ) { |
542 | 542 | # Bug 15748, be lax about commons image sync status |