Merge "Avoid joining against page table when finding a page's oldest revision."
[lhc/web/wiklou.git] / includes / skins / BaseTemplate.php
index 87865df..eef421c 100644 (file)
@@ -29,10 +29,11 @@ abstract class BaseTemplate extends QuickTemplate {
         * Get a Message object with its context set
         *
         * @param string $name Message name
+        * @param ... $params Message params
         * @return Message
         */
-       public function getMsg( $name ) {
-               return $this->getSkin()->msg( $name );
+       public function getMsg( $name /* ... */ ) {
+               return call_user_func_array( [ $this->getSkin(), 'msg' ], func_get_args() );
        }
 
        function msg( $str ) {
@@ -111,7 +112,9 @@ abstract class BaseTemplate extends QuickTemplate {
                        $toolbox['info']['id'] = 't-info';
                }
 
-               Hooks::run( 'BaseTemplateToolbox', [ &$this, &$toolbox ] );
+               // Avoid PHP 7.1 warning from passing $this by reference
+               $template = $this;
+               Hooks::run( 'BaseTemplateToolbox', [ &$template, &$toolbox ] );
                return $toolbox;
        }
 
@@ -226,7 +229,9 @@ abstract class BaseTemplate extends QuickTemplate {
                        ob_start();
                        // We pass an extra 'true' at the end so extensions using BaseTemplateToolbox
                        // can abort and avoid outputting double toolbox links
-                       Hooks::run( 'SkinTemplateToolboxEnd', [ &$this, true ] );
+                       // Avoid PHP 7.1 warning from passing $this by reference
+                       $template = $this;
+                       Hooks::run( 'SkinTemplateToolboxEnd', [ &$template, true ] );
                        $hookContents = ob_get_contents();
                        ob_end_clean();
                        if ( !trim( $hookContents ) ) {
@@ -288,7 +293,6 @@ abstract class BaseTemplate extends QuickTemplate {
                if ( $content !== '' ) {
                        echo "<div class='after-portlet after-portlet-$name'>$content</div>";
                }
-
        }
 
        /**