Merge "WebInstaller::getDocUrl: Use getUrl to generate the URL"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Sun, 10 Jun 2018 08:16:52 +0000 (08:16 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Sun, 10 Jun 2018 08:16:52 +0000 (08:16 +0000)
1  2 
includes/installer/WebInstaller.php

@@@ -717,7 -717,7 +717,7 @@@ class WebInstaller extends Installer 
         */
        public function showHelpBox( $msg /*, ... */ ) {
                $args = func_get_args();
 -              $html = call_user_func_array( [ $this, 'getHelpBox' ], $args );
 +              $html = $this->getHelpBox( ...$args );
                $this->output->addHTML( $html );
        }
  
        public function showStatusMessage( Status $status ) {
                $errors = array_merge( $status->getErrorsArray(), $status->getWarningsArray() );
                foreach ( $errors as $error ) {
 -                      call_user_func_array( [ $this, 'showMessage' ], $error );
 +                      $this->showMessage( ...$error );
                }
        }
  
         * @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 );
        }
  
        /**