Merge "Ensure the editing textarea is not higher than browser's viewport"
[lhc/web/wiklou.git] / includes / changes / RecentChange.php
index b651f86..dcab158 100644 (file)
@@ -329,7 +329,9 @@ class RecentChange {
                $this->mAttribs['rc_id'] = $dbw->insertId();
 
                # Notify extensions
-               Hooks::run( 'RecentChange_save', [ &$this ] );
+               // Avoid PHP 7.1 warning from passing $this by reference
+               $rc = $this;
+               Hooks::run( 'RecentChange_save', [ &$rc ] );
 
                if ( count( $this->tags ) ) {
                        ChangeTags::addTags( $this->tags, $this->mAttribs['rc_id'],
@@ -427,7 +429,7 @@ class RecentChange {
         * @return RCFeedEngine The engine object
         * @throws MWException
         */
-       public static function getEngine( $uri ) {
+       public static function getEngine( $uri, $params = [] ) {
                // TODO: Merge into RCFeed::factory().
                global $wgRCEngines;
                $scheme = parse_url( $uri, PHP_URL_SCHEME );
@@ -440,7 +442,7 @@ class RecentChange {
                if ( defined( 'MW_PHPUNIT_TEST' ) && is_object( $wgRCEngines[$scheme] ) ) {
                        return $wgRCEngines[$scheme];
                }
-               return new $wgRCEngines[$scheme];
+               return new $wgRCEngines[$scheme]( $params );
        }
 
        /**