r97299 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97298‎ | r97299 | r97300 >
Date:17:00, 16 September 2011
Author:reedy
Status:ok
Tags:
Comment:
Revert r91561 out of REL1_18 (essentially merging r97297, but it wasn't, as it was cleaner to revert in the local tree)
Modified paths:
  • /branches/REL1_18/phase3/RELEASE-NOTES-1.18 (modified) (history)
  • /branches/REL1_18/phase3/includes/Skin.php (modified) (history)
  • /branches/REL1_18/phase3/includes/SkinTemplate.php (modified) (history)
  • /branches/REL1_18/phase3/includes/Title.php (modified) (history)
  • /branches/REL1_18/phase3/includes/specials/SpecialUndelete.php (modified) (history)
  • /branches/REL1_18/phase3/includes/specials/SpecialUpload.php (modified) (history)

Diff [purge]

Index: branches/REL1_18/phase3/RELEASE-NOTES-1.18
@@ -330,8 +330,6 @@
331331 environments
332332 * (bug 14977) Fixed $wgServer detection in cases where an IPv6 address is used
333333 as the server name.
334 -* (bug 19725) Do not list suppressed edits in the "View X deleted edits" link
335 - if user cannot view suppressed edits.
336334 * The View X deleted revisions is now shown again on Special:Upload.
337335 * (bug 29071) mediawiki.action.watch.ajax.js should pass uselang to API.
338336 * (bug 28868) Show total pages in the subtitle of an image on the
Index: branches/REL1_18/phase3/includes/Title.php
@@ -2373,37 +2373,21 @@
23742374 /**
23752375 * Is there a version of this page in the deletion archive?
23762376 *
2377 - * @param $includeSuppressed Boolean Include suppressed revisions?
23782377 * @return Int the number of archived revisions
23792378 */
2380 - public function isDeleted( $includeSuppressed = false ) {
 2379+ public function isDeleted() {
23812380 if ( $this->getNamespace() < 0 ) {
23822381 $n = 0;
23832382 } else {
23842383 $dbr = wfGetDB( DB_SLAVE );
2385 - $conditions = array( 'ar_namespace' => $this->getNamespace(), 'ar_title' => $this->getDBkey() );
23862384
2387 - if( !$includeSuppressed ) {
2388 - $suppressedTextBits = Revision::DELETED_TEXT | Revision::DELETED_RESTRICTED;
2389 - $conditions[] = $dbr->bitAnd('ar_deleted', $suppressedTextBits ) .
2390 - ' != ' . $suppressedTextBits;
2391 - }
2392 -
23932385 $n = $dbr->selectField( 'archive', 'COUNT(*)',
2394 - $conditions,
 2386+ array( 'ar_namespace' => $this->getNamespace(), 'ar_title' => $this->getDBkey() ),
23952387 __METHOD__
23962388 );
23972389 if ( $this->getNamespace() == NS_FILE ) {
2398 - $fconditions = array( 'fa_name' => $this->getDBkey() );
2399 - if( !$includeSuppressed ) {
2400 - $suppressedTextBits = File::DELETED_FILE | File::DELETED_RESTRICTED;
2401 - $fconditions[] = $dbr->bitAnd('fa_deleted', $suppressedTextBits ) .
2402 - ' != ' . $suppressedTextBits;
2403 - }
2404 -
2405 - $n += $dbr->selectField( 'filearchive',
2406 - 'COUNT(*)',
2407 - $fconditions,
 2390+ $n += $dbr->selectField( 'filearchive', 'COUNT(*)',
 2391+ array( 'fa_name' => $this->getDBkey() ),
24082392 __METHOD__
24092393 );
24102394 }
Index: branches/REL1_18/phase3/includes/SkinTemplate.php
@@ -976,8 +976,7 @@
977977 } else {
978978 // article doesn't exist or is deleted
979979 if ( $wgUser->isAllowed( 'deletedhistory' ) ) {
980 - $includeSuppressed = $wgUser->isAllowed( 'suppressrevision' );
981 - $n = $title->isDeleted( $includeSuppressed );
 980+ $n = $title->isDeleted();
982981 if( $n ) {
983982 $undelTitle = SpecialPage::getTitleFor( 'Undelete' );
984983 // If the user can't undelete but can view deleted history show them a "View .. deleted" tab instead
Index: branches/REL1_18/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: branches/REL1_18/phase3/includes/specials/SpecialUpload.php
@@ -314,20 +314,17 @@
315315 $title = Title::makeTitleSafe( NS_FILE, $this->mDesiredDestName );
316316 // Show a subtitle link to deleted revisions (to sysops et al only)
317317 if( $title instanceof Title ) {
318 - if ( $wgUser->isAllowed( 'deletedhistory' ) ) {
319 - $canViewSuppress = $wgUser->isAllowed( 'suppressrevision' );
320 - $count = $title->isDeleted( $canViewSuppress );
321 - if ( $count > 0 ) {
322 - $link = wfMsgExt(
323 - $wgUser->isAllowed( 'delete' ) ? 'thisisdeleted' : 'viewdeleted',
324 - array( 'parse', 'replaceafter' ),
325 - $this->getSkin()->linkKnown(
326 - SpecialPage::getTitleFor( 'Undelete', $title->getPrefixedText() ),
327 - wfMsgExt( 'restorelink', array( 'parsemag', 'escape' ), $count )
328 - )
329 - );
330 - $wgOut->addHTML( "<div id=\"contentSub2\">{$link}</div>" );
331 - }
 318+ $count = $title->isDeleted();
 319+ if ( $count > 0 && $wgUser->isAllowed( 'deletedhistory' ) ) {
 320+ $link = wfMsgExt(
 321+ $wgUser->isAllowed( 'delete' ) ? 'thisisdeleted' : 'viewdeleted',
 322+ array( 'parse', 'replaceafter' ),
 323+ $this->getSkin()->linkKnown(
 324+ SpecialPage::getTitleFor( 'Undelete', $title->getPrefixedText() ),
 325+ wfMsgExt( 'restorelink', array( 'parsemag', 'escape' ), $count )
 326+ )
 327+ );
 328+ $wgOut->addHTML( "<div id=\"contentSub2\">{$link}</div>" );
332329 }
333330 }
334331 }
Index: branches/REL1_18/phase3/includes/Skin.php
@@ -727,9 +727,8 @@
728728
729729 if ( $this->getUser()->isAllowed( 'deletedhistory' ) &&
730730 ( $this->getTitle()->getArticleId() == 0 || $action == 'history' ) ) {
 731+ $n = $this->getTitle()->isDeleted();
731732
732 - $includeSuppressed = $this->getUser()->isAllowed( 'suppressrevision' );
733 - $n = $this->getTitle()->isDeleted( $includeSuppressed );
734733
735734 if ( $n ) {
736735 if ( $this->getUser()->isAllowed( 'undelete' ) ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r97320Fix extra brace from r97299reedy19:05, 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
r97297Revert r91561reedy16:55, 16 September 2011

Status & tagging log