http://www.mediawiki.org/wiki/Special:Code/MediaWiki/97297
Revision: 97297 Author: reedy Date: 2011-09-16 16:55:39 +0000 (Fri, 16 Sep 2011) Log Message: ----------- Revert r91561 Modified Paths: -------------- trunk/phase3/RELEASE-NOTES-1.18 trunk/phase3/includes/Skin.php trunk/phase3/includes/SkinTemplate.php trunk/phase3/includes/Title.php trunk/phase3/includes/specials/SpecialUndelete.php trunk/phase3/includes/specials/SpecialUpload.php trunk/phase3/languages/Language.php Modified: trunk/phase3/RELEASE-NOTES-1.18 =================================================================== --- trunk/phase3/RELEASE-NOTES-1.18 2011-09-16 16:11:54 UTC (rev 97296) +++ trunk/phase3/RELEASE-NOTES-1.18 2011-09-16 16:55:39 UTC (rev 97297) @@ -338,8 +338,6 @@ environments * (bug 14977) Fixed $wgServer detection in cases where an IPv6 address is used as the server name. -* (bug 19725) Do not list suppressed edits in the "View X deleted edits" link - if user cannot view suppressed edits. * The View X deleted revisions is now shown again on Special:Upload. * (bug 29071) mediawiki.action.watch.ajax.js should pass uselang to API. * (bug 28868) Show total pages in the subtitle of an image on the Modified: trunk/phase3/includes/Skin.php =================================================================== --- trunk/phase3/includes/Skin.php 2011-09-16 16:11:54 UTC (rev 97296) +++ trunk/phase3/includes/Skin.php 2011-09-16 16:55:39 UTC (rev 97297) @@ -638,9 +638,8 @@ if ( $this->getUser()->isAllowed( 'deletedhistory' ) && !$this->getUser()->isBlocked() && ( $this->getTitle()->getArticleId() == 0 || $action == 'history' ) ) { + $n = $this->getTitle()->isDeleted(); - $includeSuppressed = $this->getUser()->isAllowed( 'suppressrevision' ); - $n = $this->getTitle()->isDeleted( $includeSuppressed ); if ( $n ) { if ( $this->getUser()->isAllowed( 'undelete' ) ) { Modified: trunk/phase3/includes/SkinTemplate.php =================================================================== --- trunk/phase3/includes/SkinTemplate.php 2011-09-16 16:11:54 UTC (rev 97296) +++ trunk/phase3/includes/SkinTemplate.php 2011-09-16 16:55:39 UTC (rev 97297) @@ -951,9 +951,8 @@ } } else { // article doesn't exist or is deleted - if ( $user->isAllowed( 'deletedhistory' ) && !$user->isBlocked() ) { - $includeSuppressed = $user->isAllowed( 'suppressrevision' ); - $n = $title->isDeleted( $includeSuppressed ); + if ( $user->isAllowed( 'deletedhistory' ) ) { + $n = $title->isDeleted(); if( $n ) { $undelTitle = SpecialPage::getTitleFor( 'Undelete' ); // If the user can't undelete but can view deleted history show them a "View .. deleted" tab instead Modified: trunk/phase3/includes/Title.php =================================================================== --- trunk/phase3/includes/Title.php 2011-09-16 16:11:54 UTC (rev 97296) +++ trunk/phase3/includes/Title.php 2011-09-16 16:55:39 UTC (rev 97297) @@ -2391,37 +2391,21 @@ /** * Is there a version of this page in the deletion archive? * - * @param $includeSuppressed Boolean Include suppressed revisions? * @return Int the number of archived revisions */ - public function isDeleted( $includeSuppressed = false ) { + public function isDeleted() { if ( $this->getNamespace() < 0 ) { $n = 0; } else { $dbr = wfGetDB( DB_SLAVE ); - $conditions = array( 'ar_namespace' => $this->getNamespace(), 'ar_title' => $this->getDBkey() ); - if( !$includeSuppressed ) { - $suppressedTextBits = Revision::DELETED_TEXT | Revision::DELETED_RESTRICTED; - $conditions[] = $dbr->bitAnd('ar_deleted', $suppressedTextBits ) . - ' != ' . $suppressedTextBits; - } - $n = $dbr->selectField( 'archive', 'COUNT(*)', - $conditions, + array( 'ar_namespace' => $this->getNamespace(), 'ar_title' => $this->getDBkey() ), __METHOD__ ); if ( $this->getNamespace() == NS_FILE ) { - $fconditions = array( 'fa_name' => $this->getDBkey() ); - if( !$includeSuppressed ) { - $suppressedTextBits = File::DELETED_FILE | File::DELETED_RESTRICTED; - $fconditions[] = $dbr->bitAnd('fa_deleted', $suppressedTextBits ) . - ' != ' . $suppressedTextBits; - } - - $n += $dbr->selectField( 'filearchive', - 'COUNT(*)', - $fconditions, + $n += $dbr->selectField( 'filearchive', 'COUNT(*)', + array( 'fa_name' => $this->getDBkey() ), __METHOD__ ); } Modified: trunk/phase3/includes/specials/SpecialUndelete.php =================================================================== --- trunk/phase3/includes/specials/SpecialUndelete.php 2011-09-16 16:11:54 UTC (rev 97296) +++ trunk/phase3/includes/specials/SpecialUndelete.php 2011-09-16 16:55:39 UTC (rev 97297) @@ -62,7 +62,6 @@ * @return ResultWrapper */ public static function listPagesByPrefix( $prefix ) { - global $wgUser; $dbr = wfGetDB( DB_SLAVE ); $title = Title::newFromText( $prefix ); @@ -78,12 +77,6 @@ 'ar_namespace' => $ns, 'ar_title' . $dbr->buildLike( $prefix, $dbr->anyString() ), ); - - // bug 19725 - $suppressedText = Revision::DELETED_TEXT | Revision::DELETED_RESTRICTED; - if( !$wgUser->isAllowed( 'suppressrevision' ) ) { - $conds[] = $dbr->bitAnd('ar_deleted', $suppressedText ) . - ' != ' . $suppressedText; } return self::listPages( $dbr, $conds ); } Modified: trunk/phase3/includes/specials/SpecialUpload.php =================================================================== --- trunk/phase3/includes/specials/SpecialUpload.php 2011-09-16 16:11:54 UTC (rev 97296) +++ trunk/phase3/includes/specials/SpecialUpload.php 2011-09-16 16:55:39 UTC (rev 97297) @@ -300,10 +300,9 @@ $title = Title::makeTitleSafe( NS_FILE, $this->mDesiredDestName ); $user = $this->getUser(); // Show a subtitle link to deleted revisions (to sysops et al only) - if( $title instanceof Title && $user->isAllowed( 'deletedhistory' ) && !$user->isBlocked() ) { - $canViewSuppress = $user->isAllowed( 'suppressrevision' ); - $count = $title->isDeleted( $canViewSuppress ); - if ( $count > 0 ) { + if( $title instanceof Title ) { + $count = $title->isDeleted(); + if ( $count > 0 && $user->isAllowed( 'deletedhistory' ) ) { $link = wfMsgExt( $user->isAllowed( 'delete' ) ? 'thisisdeleted' : 'viewdeleted', array( 'parse', 'replaceafter' ), Modified: trunk/phase3/languages/Language.php =================================================================== --- trunk/phase3/languages/Language.php 2011-09-16 16:11:54 UTC (rev 97296) +++ trunk/phase3/languages/Language.php 2011-09-16 16:55:39 UTC (rev 97297) @@ -232,7 +232,7 @@ /** * Includes language class files - * + * * @param $class Name of the language class */ public static function preloadLanguageClass( $class ) { @@ -1259,7 +1259,6 @@ - floor( ( $gy + 99 ) / 100 ) + floor( ( $gy + 399 ) / 400 ); - // Add days of the past months of this year for ( $i = 0; $i < $gm; $i++ ) { $gDayNo += self::$GREG_DAYS[$i]; @@ -3337,7 +3336,7 @@ } /** - * Get the first fallback for a given language. + * Get the first fallback for a given language. * * @param $code string * @@ -3397,7 +3396,7 @@ static function getMessageFor( $key, $code ) { return self::getLocalisationCache()->getSubitem( $code, 'messages', $key ); } - + /** * Get all message keys for a given language. This is a faster alternative to * array_keys( Language::getMessagesFor( $code ) ) _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs