r97297 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97296‎ | r97297 | r97298 >
Date:16:55, 16 September 2011
Author:reedy
Status:ok
Tags:
Comment:
Revert r91561
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.18 (modified) (history)
  • /trunk/phase3/includes/Skin.php (modified) (history)
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUndelete.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUpload.php (modified) (history)
  • /trunk/phase3/languages/Language.php (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.18
@@ -338,8 +338,6 @@
339339 environments
340340 * (bug 14977) Fixed $wgServer detection in cases where an IPv6 address is used
341341 as the server name.
342 -* (bug 19725) Do not list suppressed edits in the "View X deleted edits" link
343 - if user cannot view suppressed edits.
344342 * The View X deleted revisions is now shown again on Special:Upload.
345343 * (bug 29071) mediawiki.action.watch.ajax.js should pass uselang to API.
346344 * (bug 28868) Show total pages in the subtitle of an image on the
Index: trunk/phase3/includes/Title.php
@@ -2391,37 +2391,21 @@
23922392 /**
23932393 * Is there a version of this page in the deletion archive?
23942394 *
2395 - * @param $includeSuppressed Boolean Include suppressed revisions?
23962395 * @return Int the number of archived revisions
23972396 */
2398 - public function isDeleted( $includeSuppressed = false ) {
 2397+ public function isDeleted() {
23992398 if ( $this->getNamespace() < 0 ) {
24002399 $n = 0;
24012400 } else {
24022401 $dbr = wfGetDB( DB_SLAVE );
2403 - $conditions = array( 'ar_namespace' => $this->getNamespace(), 'ar_title' => $this->getDBkey() );
24042402
2405 - if( !$includeSuppressed ) {
2406 - $suppressedTextBits = Revision::DELETED_TEXT | Revision::DELETED_RESTRICTED;
2407 - $conditions[] = $dbr->bitAnd('ar_deleted', $suppressedTextBits ) .
2408 - ' != ' . $suppressedTextBits;
2409 - }
2410 -
24112403 $n = $dbr->selectField( 'archive', 'COUNT(*)',
2412 - $conditions,
 2404+ array( 'ar_namespace' => $this->getNamespace(), 'ar_title' => $this->getDBkey() ),
24132405 __METHOD__
24142406 );
24152407 if ( $this->getNamespace() == NS_FILE ) {
2416 - $fconditions = array( 'fa_name' => $this->getDBkey() );
2417 - if( !$includeSuppressed ) {
2418 - $suppressedTextBits = File::DELETED_FILE | File::DELETED_RESTRICTED;
2419 - $fconditions[] = $dbr->bitAnd('fa_deleted', $suppressedTextBits ) .
2420 - ' != ' . $suppressedTextBits;
2421 - }
2422 -
2423 - $n += $dbr->selectField( 'filearchive',
2424 - 'COUNT(*)',
2425 - $fconditions,
 2408+ $n += $dbr->selectField( 'filearchive', 'COUNT(*)',
 2409+ array( 'fa_name' => $this->getDBkey() ),
24262410 __METHOD__
24272411 );
24282412 }
Index: trunk/phase3/includes/SkinTemplate.php
@@ -951,9 +951,8 @@
952952 }
953953 } else {
954954 // article doesn't exist or is deleted
955 - if ( $user->isAllowed( 'deletedhistory' ) && !$user->isBlocked() ) {
956 - $includeSuppressed = $user->isAllowed( 'suppressrevision' );
957 - $n = $title->isDeleted( $includeSuppressed );
 955+ if ( $user->isAllowed( 'deletedhistory' ) ) {
 956+ $n = $title->isDeleted();
958957 if( $n ) {
959958 $undelTitle = SpecialPage::getTitleFor( 'Undelete' );
960959 // If the user can't undelete but can view deleted history show them a "View .. deleted" tab instead
Index: trunk/phase3/includes/specials/SpecialUndelete.php
@@ -62,7 +62,6 @@
6363 * @return ResultWrapper
6464 */
6565 public static function listPagesByPrefix( $prefix ) {
66 - global $wgUser;
6766 $dbr = wfGetDB( DB_SLAVE );
6867
6968 $title = Title::newFromText( $prefix );
@@ -78,12 +77,6 @@
7978 'ar_namespace' => $ns,
8079 'ar_title' . $dbr->buildLike( $prefix, $dbr->anyString() ),
8180 );
82 -
83 - // bug 19725
84 - $suppressedText = Revision::DELETED_TEXT | Revision::DELETED_RESTRICTED;
85 - if( !$wgUser->isAllowed( 'suppressrevision' ) ) {
86 - $conds[] = $dbr->bitAnd('ar_deleted', $suppressedText ) .
87 - ' != ' . $suppressedText;
8881 }
8982 return self::listPages( $dbr, $conds );
9083 }
Index: trunk/phase3/includes/specials/SpecialUpload.php
@@ -300,10 +300,9 @@
301301 $title = Title::makeTitleSafe( NS_FILE, $this->mDesiredDestName );
302302 $user = $this->getUser();
303303 // Show a subtitle link to deleted revisions (to sysops et al only)
304 - if( $title instanceof Title && $user->isAllowed( 'deletedhistory' ) && !$user->isBlocked() ) {
305 - $canViewSuppress = $user->isAllowed( 'suppressrevision' );
306 - $count = $title->isDeleted( $canViewSuppress );
307 - if ( $count > 0 ) {
 304+ if( $title instanceof Title ) {
 305+ $count = $title->isDeleted();
 306+ if ( $count > 0 && $user->isAllowed( 'deletedhistory' ) ) {
308307 $link = wfMsgExt(
309308 $user->isAllowed( 'delete' ) ? 'thisisdeleted' : 'viewdeleted',
310309 array( 'parse', 'replaceafter' ),
Index: trunk/phase3/includes/Skin.php
@@ -638,9 +638,8 @@
639639
640640 if ( $this->getUser()->isAllowed( 'deletedhistory' ) && !$this->getUser()->isBlocked() &&
641641 ( $this->getTitle()->getArticleId() == 0 || $action == 'history' ) ) {
 642+ $n = $this->getTitle()->isDeleted();
642643
643 - $includeSuppressed = $this->getUser()->isAllowed( 'suppressrevision' );
644 - $n = $this->getTitle()->isDeleted( $includeSuppressed );
645644
646645 if ( $n ) {
647646 if ( $this->getUser()->isAllowed( 'undelete' ) ) {
Index: trunk/phase3/languages/Language.php
@@ -232,7 +232,7 @@
233233
234234 /**
235235 * Includes language class files
236 - *
 236+ *
237237 * @param $class Name of the language class
238238 */
239239 public static function preloadLanguageClass( $class ) {
@@ -1259,7 +1259,6 @@
12601260 - floor( ( $gy + 99 ) / 100 )
12611261 + floor( ( $gy + 399 ) / 400 );
12621262
1263 -
12641263 // Add days of the past months of this year
12651264 for ( $i = 0; $i < $gm; $i++ ) {
12661265 $gDayNo += self::$GREG_DAYS[$i];
@@ -3337,7 +3336,7 @@
33383337 }
33393338
33403339 /**
3341 - * Get the first fallback for a given language.
 3340+ * Get the first fallback for a given language.
33423341 *
33433342 * @param $code string
33443343 *
@@ -3397,7 +3396,7 @@
33983397 static function getMessageFor( $key, $code ) {
33993398 return self::getLocalisationCache()->getSubitem( $code, 'messages', $key );
34003399 }
3401 -
 3400+
34023401 /**
34033402 * Get all message keys for a given language. This is a faster alternative to
34043403 * array_keys( Language::getMessagesFor( $code ) )

Follow-up revisions

RevisionCommit summaryAuthorDate
r97299Revert r91561 out of REL1_18 (essentially merging r97297, but it wasn't, as i...reedy17:00, 16 September 2011
r97318Fix extra bracereedy19:03, 16 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r91561(Bug 19725) Do not include suppressed edits in the "View X deleted edits" mes...bawolff16:47, 6 July 2011

Status & tagging log