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
Document Special:Diff and Special:PermanentLink
[lhc/web/wiklou.git]
/
includes
/
specialpage
/
RedirectSpecialPage.php
diff --git
a/includes/specialpage/RedirectSpecialPage.php
b/includes/specialpage/RedirectSpecialPage.php
index
5047354
..
4e5da97
100644
(file)
--- a/
includes/specialpage/RedirectSpecialPage.php
+++ b/
includes/specialpage/RedirectSpecialPage.php
@@
-28,10
+28,10
@@
*/
abstract class RedirectSpecialPage extends UnlistedSpecialPage {
// Query parameters that can be passed through redirects
*/
abstract class RedirectSpecialPage extends UnlistedSpecialPage {
// Query parameters that can be passed through redirects
- protected $mAllowedRedirectParams =
array()
;
+ protected $mAllowedRedirectParams =
[]
;
// Query parameters added by redirects
// Query parameters added by redirects
- protected $mAddedRedirectParams =
array()
;
+ protected $mAddedRedirectParams =
[]
;
/**
* @param string|null $subpage
/**
* @param string|null $subpage
@@
-41,7
+41,7
@@
abstract class RedirectSpecialPage extends UnlistedSpecialPage {
$query = $this->getRedirectQuery();
// Redirect to a page title with possible query parameters
if ( $redirect instanceof Title ) {
$query = $this->getRedirectQuery();
// Redirect to a page title with possible query parameters
if ( $redirect instanceof Title ) {
- $url = $redirect->getFullU
RL
( $query );
+ $url = $redirect->getFullU
rlForRedirect
( $query );
$this->getOutput()->redirect( $url );
return $redirect;
$this->getOutput()->redirect( $url );
return $redirect;
@@
-52,8
+52,7
@@
abstract class RedirectSpecialPage extends UnlistedSpecialPage {
return $redirect;
} else {
return $redirect;
} else {
- $class = get_class( $this );
- throw new MWException( "RedirectSpecialPage $class doesn't redirect!" );
+ $this->showNoRedirectPage();
}
}
}
}
@@
-73,11
+72,11
@@
abstract class RedirectSpecialPage extends UnlistedSpecialPage {
* @return array|bool
*/
public function getRedirectQuery() {
* @return array|bool
*/
public function getRedirectQuery() {
- $params =
array()
;
+ $params =
[]
;
$request = $this->getRequest();
foreach ( array_merge( $this->mAllowedRedirectParams,
$request = $this->getRequest();
foreach ( array_merge( $this->mAllowedRedirectParams,
-
array( 'uselang', 'useskin', 'debug' )
// parameters which can be passed to all pages
+
[ 'uselang', 'useskin', 'debug' ]
// parameters which can be passed to all pages
) as $arg ) {
if ( $request->getVal( $arg, null ) !== null ) {
$params[$arg] = $request->getVal( $arg );
) as $arg ) {
if ( $request->getVal( $arg, null ) !== null ) {
$params[$arg] = $request->getVal( $arg );
@@
-106,6
+105,11
@@
abstract class RedirectSpecialPage extends UnlistedSpecialPage {
public function personallyIdentifiableTarget() {
return false;
}
public function personallyIdentifiableTarget() {
return false;
}
+
+ protected function showNoRedirectPage() {
+ $class = static::class;
+ throw new MWException( "RedirectSpecialPage $class doesn't redirect!" );
+ }
}
/**
}
/**
@@
-120,7
+124,7
@@
abstract class SpecialRedirectToSpecial extends RedirectSpecialPage {
function __construct(
$name, $redirName, $redirSubpage = false,
function __construct(
$name, $redirName, $redirSubpage = false,
- $allowedRedirectParams =
array(), $addedRedirectParams = array()
+ $allowedRedirectParams =
[], $addedRedirectParams = []
) {
parent::__construct( $name );
$this->redirName = $redirName;
) {
parent::__construct( $name );
$this->redirName = $redirName;
@@
-208,7
+212,7
@@
abstract class SpecialRedirectToSpecial extends RedirectSpecialPage {
abstract class RedirectSpecialArticle extends RedirectSpecialPage {
function __construct( $name ) {
parent::__construct( $name );
abstract class RedirectSpecialArticle extends RedirectSpecialPage {
function __construct( $name ) {
parent::__construct( $name );
- $redirectParams =
array(
+ $redirectParams =
[
'action',
'redirect', 'rdfrom',
# Options for preloaded edits
'action',
'redirect', 'rdfrom',
# Options for preloaded edits
@@
-222,9
+226,9
@@
abstract class RedirectSpecialArticle extends RedirectSpecialPage {
'redlink',
# Options for action=raw; missing ctype can break JS or CSS in some browsers
'ctype', 'maxage', 'smaxage',
'redlink',
# Options for action=raw; missing ctype can break JS or CSS in some browsers
'ctype', 'maxage', 'smaxage',
-
)
;
+
]
;
- Hooks::run( "RedirectSpecialArticleRedirectParams",
array( &$redirectParams )
);
+ Hooks::run( "RedirectSpecialArticleRedirectParams",
[ &$redirectParams ]
);
$this->mAllowedRedirectParams = $redirectParams;
}
}
$this->mAllowedRedirectParams = $redirectParams;
}
}