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
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' ) ) {
}
} 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
/**
* 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__
);
}
* @return ResultWrapper
*/
public static function listPagesByPrefix( $prefix ) {
- global $wgUser;
$dbr = wfGetDB( DB_SLAVE );
$title = Title::newFromText( $prefix );
'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 );
}
$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' ),
/**
* Includes language class files
- *
+ *
* @param $class Name of the language class
*/
public static function preloadLanguageClass( $class ) {
- 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];
}
/**
- * Get the first fallback for a given language.
+ * Get the first fallback for a given language.
*
* @param $code string
*
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 ) )