WebInstaller::getDocUrl: Use getUrl to generate the URL
authorFomafix <fomafix@googlemail.com>
Thu, 7 Jun 2018 08:07:15 +0000 (10:07 +0200)
committerFomafix <fomafix@googlemail.com>
Thu, 7 Jun 2018 09:19:02 +0000 (11:19 +0200)
This changes ensures to generate the same URLs on doclinks like in the
navigation bar.

mw-config/?page=Welcome has as "Restart installation" the URL
  /.../mw-config/?page=Restart&lastPage=Language
and as "a copy of the GNU General Public License" the URL
before this change
  /.../mw-config/index.php?page=Copying&lastPage=Welcome
after this change
  /.../mw-config/?page=Copying&lastPage=Welcome

Change-Id: Ide5cb52d71363c3a54e1b6ac48c272e1de823322

includes/installer/WebInstaller.php

index 8fb9807..d754a37 100644 (file)
@@ -1121,13 +1121,13 @@ class WebInstaller extends Installer {
         * @return string
         */
        protected function getDocUrl( $page ) {
-               $url = "{$_SERVER['PHP_SELF']}?page=" . urlencode( $page );
+               $query = [ 'page' => $page ];
 
                if ( in_array( $this->currentPageName, $this->pageSequence ) ) {
-                       $url .= '&lastPage=' . urlencode( $this->currentPageName );
+                       $query['lastPage'] = $this->currentPageName;
                }
 
-               return $url;
+               return $this->getUrl( $query );
        }
 
        /**