Merge "Relax phpdoc of PermissionError to match actual usage"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 20 Oct 2016 21:16:31 +0000 (21:16 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 20 Oct 2016 21:16:31 +0000 (21:16 +0000)
1  2 
includes/OutputPage.php

diff --combined includes/OutputPage.php
@@@ -1782,9 -1782,7 +1782,9 @@@ class OutputPage extends ContextSource 
                }
  
                // Include profiling data
 -              $this->setLimitReportData( $parserOutput->getLimitReportData() );
 +              if ( !$this->limitReportData ) {
 +                      $this->setLimitReportData( $parserOutput->getLimitReportData() );
 +              }
  
                // Link flags are ignored for now, but may in the future be
                // used to mark individual language links.
        /**
         * Output a standard permission error page
         *
-        * @param array $errors Error message keys
+        * @param array $errors Error message keys or [key, param...] arrays
         * @param string $action Action that was denied or null if unknown
         */
        public function showPermissionsErrorPage( array $errors, $action = null ) {
+               foreach ( $errors as $key => $error ) {
+                       $errors[$key] = (array)$error;
+               }
                // For some action (read, edit, create and upload), display a "login to do this action"
                // error if all of the following conditions are met:
                // 1. the user is not logged in
                        }
                }
  
 -              $chunks[] = ResourceLoader::makeInlineScript(
 -                      ResourceLoader::makeConfigSetScript(
 -                              [ 'wgPageParseReport' => $this->limitReportData ],
 -                              true
 -                      )
 -              );
 +              if ( $this->limitReportData ) {
 +                      $chunks[] = ResourceLoader::makeInlineScript(
 +                              ResourceLoader::makeConfigSetScript(
 +                                      [ 'wgPageParseReport' => $this->limitReportData ],
 +                                      true
 +                              )
 +                      );
 +              }
  
                return self::combineWrappedStrings( $chunks );
        }