Merge "SpecialSearchResults hooks does not use by-ref anymore"
[lhc/web/wiklou.git] / includes / Revision.php
index a74501f..8721ef9 100644 (file)
@@ -1131,7 +1131,7 @@ class Revision implements IDBAccessObject {
         *
         * @return string The content model id associated with this revision,
         *     see the CONTENT_MODEL_XXX constants.
-        **/
+        */
        public function getContentModel() {
                if ( !$this->mContentModel ) {
                        $title = $this->getTitle();
@@ -1155,7 +1155,7 @@ class Revision implements IDBAccessObject {
         *
         * @return string The content format id associated with this revision,
         *     see the CONTENT_FORMAT_XXX constants.
-        **/
+        */
        public function getContentFormat() {
                if ( !$this->mContentFormat ) {
                        $handler = $this->getContentHandler();
@@ -1505,7 +1505,9 @@ class Revision implements IDBAccessObject {
                        );
                }
 
-               Hooks::run( 'RevisionInsertComplete', [ &$this, $data, $flags ] );
+               // Avoid PHP 7.1 warning of passing $this by reference
+               $revision = $this;
+               Hooks::run( 'RevisionInsertComplete', [ &$revision, $data, $flags ] );
 
                return $this->mId;
        }