Move up devunt's name to Developers
[lhc/web/wiklou.git] / includes / specials / SpecialFilepath.php
index e7ced52..542589f 100644 (file)
@@ -2,7 +2,6 @@
 /**
  * Implements Special:Filepath
  *
- * @section LICENSE
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * @ingroup SpecialPage
  */
 class SpecialFilepath extends RedirectSpecialPage {
-       function __construct() {
+       public function __construct() {
                parent::__construct( 'Filepath' );
                $this->mAllowedRedirectParams = array( 'width', 'height' );
        }
 
-       // implement by redirecting through Special:Redirect/file
-       function getRedirect( $par ) {
+       /**
+        * Implement by redirecting through Special:Redirect/file.
+        *
+        * @param string|null $subpage
+        * @return Title
+        */
+       public function getRedirect( $par ) {
                $file = $par ?: $this->getRequest()->getText( 'file' );
-               return SpecialPage::getSafeTitleFor( 'Redirect', 'file/' . $file );
+
+               if ( $file ) {
+                       $argument = "file/$file";
+               } else {
+                       $argument = 'file';
+               }
+               return SpecialPage::getSafeTitleFor( 'Redirect', $argument );
        }
 
        protected function getGroupName() {