MediaWiki REL1_31
SpecialFilepath.php
Go to the documentation of this file.
1<?php
30 public function __construct() {
31 parent::__construct( 'Filepath' );
32 $this->mAllowedRedirectParams = [ 'width', 'height' ];
33 }
34
41 public function getRedirect( $par ) {
42 $file = $par ?: $this->getRequest()->getText( 'file' );
43
44 if ( $file ) {
45 $argument = "file/$file";
46 } else {
47 $argument = 'file';
48 }
49 return SpecialPage::getSafeTitleFor( 'Redirect', $argument );
50 }
51
52 protected function getGroupName() {
53 return 'media';
54 }
55}
Shortcut to construct a special page alias.
A special page that redirects to the URL of a given file.
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
getRedirect( $par)
Implement by redirecting through Special:Redirect/file.
static getSafeTitleFor( $name, $subpage=false)
Get a localised Title object for a page name with a possibly unvalidated subpage.
getRequest()
Get the WebRequest being used for this instance.