dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Stop calling FileRepo->streamFile()
[lhc/web/wiklou.git]
/
includes
/
specials
/
SpecialUndelete.php
diff --git
a/includes/specials/SpecialUndelete.php
b/includes/specials/SpecialUndelete.php
index
3e560ad
..
456face
100644
(file)
--- a/
includes/specials/SpecialUndelete.php
+++ b/
includes/specials/SpecialUndelete.php
@@
-95,7
+95,8
@@
class SpecialUndelete extends SpecialPage {
$this->mUnsuppress = $request->getVal( 'wpUnsuppress' ) && $user->isAllowed( 'suppressrevision' );
$this->mToken = $request->getVal( 'token' );
$this->mUnsuppress = $request->getVal( 'wpUnsuppress' ) && $user->isAllowed( 'suppressrevision' );
$this->mToken = $request->getVal( 'token' );
- if ( $this->isAllowed( 'undelete' ) && !$user->isBlocked() ) {
+ $block = $user->getBlock();
+ if ( $this->isAllowed( 'undelete' ) && !( $block && $block->isSitewide() ) ) {
$this->mAllowed = true; // user can restore
$this->mCanView = true; // user can view content
} elseif ( $this->isAllowed( 'deletedtext' ) ) {
$this->mAllowed = true; // user can restore
$this->mCanView = true; // user can view content
} elseif ( $this->isAllowed( 'deletedtext' ) ) {
@@
-199,7
+200,7
@@
class SpecialUndelete extends SpecialPage {
} else {
$this->showFile( $this->mFilename );
}
} else {
$this->showFile( $this->mFilename );
}
- } elseif ( $this->mAction ===
"submit"
) {
+ } elseif ( $this->mAction ===
'submit'
) {
if ( $this->mRestore ) {
$this->undelete();
} elseif ( $this->mRevdel ) {
if ( $this->mRestore ) {
$this->undelete();
} elseif ( $this->mRevdel ) {
@@
-223,13
+224,14
@@
class SpecialUndelete extends SpecialPage {
foreach ( $this->getRequest()->getValues() as $key => $val ) {
$matches = [];
if ( preg_match( "/^ts(\d{14})$/", $key, $matches ) ) {
foreach ( $this->getRequest()->getValues() as $key => $val ) {
$matches = [];
if ( preg_match( "/^ts(\d{14})$/", $key, $matches ) ) {
- $revisions[
$archive->getRevision( $matches[1] )->getId()
] = 1;
+ $revisions[
$archive->getRevision( $matches[1] )->getId()
] = 1;
}
}
}
}
+
$query = [
$query = [
-
"type" => "revision"
,
-
"ids"
=> $revisions,
-
"target"
=> $this->mTargetObj->getPrefixedText()
+
'type' => 'revision'
,
+
'ids'
=> $revisions,
+
'target'
=> $this->mTargetObj->getPrefixedText()
];
$url = SpecialPage::getTitleFor( 'Revisiondelete' )->getFullURL( $query );
$this->getOutput()->redirect( $url );
];
$url = SpecialPage::getTitleFor( 'Revisiondelete' )->getFullURL( $query );
$this->getOutput()->redirect( $url );
@@
-455,7
+457,7
@@
class SpecialUndelete extends SpecialPage {
Message::rawParam( $link ), $time,
Message::rawParam( $userLink ), $d, $t
);
Message::rawParam( $link ), $time,
Message::rawParam( $userLink ), $d, $t
);
- $out->addH
tml
( '</div>' );
+ $out->addH
TML
( '</div>' );
if ( !Hooks::run( 'UndeleteShowRevision', [ $this->mTargetObj, $rev ] ) ) {
return;
if ( !Hooks::run( 'UndeleteShowRevision', [ $this->mTargetObj, $rev ] ) ) {
return;
@@
-502,7
+504,6
@@
class SpecialUndelete extends SpecialPage {
] );
} else {
$sourceView = '';
] );
} else {
$sourceView = '';
- $previewButton = '';
}
$buttonFields[] = new OOUI\ButtonInputWidget( [
}
$buttonFields[] = new OOUI\ButtonInputWidget( [
@@
-548,7
+549,6
@@
class SpecialUndelete extends SpecialPage {
*
* @param Revision $previousRev
* @param Revision $currentRev
*
* @param Revision $previousRev
* @param Revision $currentRev
- * @return string HTML
*/
function showDiff( $previousRev, $currentRev ) {
$diffContext = clone $this->getContext();
*/
function showDiff( $previousRev, $currentRev ) {
$diffContext = clone $this->getContext();
@@
-687,7
+687,7
@@
class SpecialUndelete extends SpecialPage {
$repo = RepoGroup::singleton()->getLocalRepo();
$path = $repo->getZonePath( 'deleted' ) . '/' . $repo->getDeletedHashPath( $key ) . $key;
$repo = RepoGroup::singleton()->getLocalRepo();
$path = $repo->getZonePath( 'deleted' ) . '/' . $repo->getDeletedHashPath( $key ) . $key;
- $repo->streamFile( $path );
+ $repo->streamFile
WithStatus
( $path );
}
protected function showHistory() {
}
protected function showHistory() {