Index: trunk/phase3/RELEASE-NOTES-1.18 |
— | — | @@ -338,8 +338,6 @@ |
339 | 339 | environments |
340 | 340 | * (bug 14977) Fixed $wgServer detection in cases where an IPv6 address is used |
341 | 341 | 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. |
344 | 342 | * The View X deleted revisions is now shown again on Special:Upload. |
345 | 343 | * (bug 29071) mediawiki.action.watch.ajax.js should pass uselang to API. |
346 | 344 | * (bug 28868) Show total pages in the subtitle of an image on the |
Index: trunk/phase3/includes/Title.php |
— | — | @@ -2391,37 +2391,21 @@ |
2392 | 2392 | /** |
2393 | 2393 | * Is there a version of this page in the deletion archive? |
2394 | 2394 | * |
2395 | | - * @param $includeSuppressed Boolean Include suppressed revisions? |
2396 | 2395 | * @return Int the number of archived revisions |
2397 | 2396 | */ |
2398 | | - public function isDeleted( $includeSuppressed = false ) { |
| 2397 | + public function isDeleted() { |
2399 | 2398 | if ( $this->getNamespace() < 0 ) { |
2400 | 2399 | $n = 0; |
2401 | 2400 | } else { |
2402 | 2401 | $dbr = wfGetDB( DB_SLAVE ); |
2403 | | - $conditions = array( 'ar_namespace' => $this->getNamespace(), 'ar_title' => $this->getDBkey() ); |
2404 | 2402 | |
2405 | | - if( !$includeSuppressed ) { |
2406 | | - $suppressedTextBits = Revision::DELETED_TEXT | Revision::DELETED_RESTRICTED; |
2407 | | - $conditions[] = $dbr->bitAnd('ar_deleted', $suppressedTextBits ) . |
2408 | | - ' != ' . $suppressedTextBits; |
2409 | | - } |
2410 | | - |
2411 | 2403 | $n = $dbr->selectField( 'archive', 'COUNT(*)', |
2412 | | - $conditions, |
| 2404 | + array( 'ar_namespace' => $this->getNamespace(), 'ar_title' => $this->getDBkey() ), |
2413 | 2405 | __METHOD__ |
2414 | 2406 | ); |
2415 | 2407 | 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() ), |
2426 | 2410 | __METHOD__ |
2427 | 2411 | ); |
2428 | 2412 | } |
Index: trunk/phase3/includes/SkinTemplate.php |
— | — | @@ -951,9 +951,8 @@ |
952 | 952 | } |
953 | 953 | } else { |
954 | 954 | // 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(); |
958 | 957 | if( $n ) { |
959 | 958 | $undelTitle = SpecialPage::getTitleFor( 'Undelete' ); |
960 | 959 | // 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 @@ |
63 | 63 | * @return ResultWrapper |
64 | 64 | */ |
65 | 65 | public static function listPagesByPrefix( $prefix ) { |
66 | | - global $wgUser; |
67 | 66 | $dbr = wfGetDB( DB_SLAVE ); |
68 | 67 | |
69 | 68 | $title = Title::newFromText( $prefix ); |
— | — | @@ -78,12 +77,6 @@ |
79 | 78 | 'ar_namespace' => $ns, |
80 | 79 | 'ar_title' . $dbr->buildLike( $prefix, $dbr->anyString() ), |
81 | 80 | ); |
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; |
88 | 81 | } |
89 | 82 | return self::listPages( $dbr, $conds ); |
90 | 83 | } |
Index: trunk/phase3/includes/specials/SpecialUpload.php |
— | — | @@ -300,10 +300,9 @@ |
301 | 301 | $title = Title::makeTitleSafe( NS_FILE, $this->mDesiredDestName ); |
302 | 302 | $user = $this->getUser(); |
303 | 303 | // 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' ) ) { |
308 | 307 | $link = wfMsgExt( |
309 | 308 | $user->isAllowed( 'delete' ) ? 'thisisdeleted' : 'viewdeleted', |
310 | 309 | array( 'parse', 'replaceafter' ), |
Index: trunk/phase3/includes/Skin.php |
— | — | @@ -638,9 +638,8 @@ |
639 | 639 | |
640 | 640 | if ( $this->getUser()->isAllowed( 'deletedhistory' ) && !$this->getUser()->isBlocked() && |
641 | 641 | ( $this->getTitle()->getArticleId() == 0 || $action == 'history' ) ) { |
| 642 | + $n = $this->getTitle()->isDeleted(); |
642 | 643 | |
643 | | - $includeSuppressed = $this->getUser()->isAllowed( 'suppressrevision' ); |
644 | | - $n = $this->getTitle()->isDeleted( $includeSuppressed ); |
645 | 644 | |
646 | 645 | if ( $n ) { |
647 | 646 | if ( $this->getUser()->isAllowed( 'undelete' ) ) { |
Index: trunk/phase3/languages/Language.php |
— | — | @@ -232,7 +232,7 @@ |
233 | 233 | |
234 | 234 | /** |
235 | 235 | * Includes language class files |
236 | | - * |
| 236 | + * |
237 | 237 | * @param $class Name of the language class |
238 | 238 | */ |
239 | 239 | public static function preloadLanguageClass( $class ) { |
— | — | @@ -1259,7 +1259,6 @@ |
1260 | 1260 | - floor( ( $gy + 99 ) / 100 ) |
1261 | 1261 | + floor( ( $gy + 399 ) / 400 ); |
1262 | 1262 | |
1263 | | - |
1264 | 1263 | // Add days of the past months of this year |
1265 | 1264 | for ( $i = 0; $i < $gm; $i++ ) { |
1266 | 1265 | $gDayNo += self::$GREG_DAYS[$i]; |
— | — | @@ -3337,7 +3336,7 @@ |
3338 | 3337 | } |
3339 | 3338 | |
3340 | 3339 | /** |
3341 | | - * Get the first fallback for a given language. |
| 3340 | + * Get the first fallback for a given language. |
3342 | 3341 | * |
3343 | 3342 | * @param $code string |
3344 | 3343 | * |
— | — | @@ -3397,7 +3396,7 @@ |
3398 | 3397 | static function getMessageFor( $key, $code ) { |
3399 | 3398 | return self::getLocalisationCache()->getSubitem( $code, 'messages', $key ); |
3400 | 3399 | } |
3401 | | - |
| 3400 | + |
3402 | 3401 | /** |
3403 | 3402 | * Get all message keys for a given language. This is a faster alternative to |
3404 | 3403 | * array_keys( Language::getMessagesFor( $code ) ) |