From: Kunal Mehta Date: Thu, 7 Jun 2018 19:52:04 +0000 (-0700) Subject: Ensure $user is passed by reference in TitleMoveComplete hook on HHVM X-Git-Tag: 1.31.0~5 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=859af2389b1170bfccd8ac03a0fefd6c109f0626 Ensure $user is passed by reference in TitleMoveComplete hook on HHVM Suggested by Anomie in T118683#3688320. Bug: T118683 Change-Id: I57e05c5ae42c8b85d0a8f9631a459c5686b27893 (cherry picked from commit d5e4bf920c7ff48bf4c907bee1ee47fa96907774) --- diff --git a/RELEASE-NOTES-1.31 b/RELEASE-NOTES-1.31 index c98f6633ef..6f242fbb10 100644 --- a/RELEASE-NOTES-1.31 +++ b/RELEASE-NOTES-1.31 @@ -11,6 +11,7 @@ production. * (T196185) Don't allow setting $wgDBmysql5 in the installer. * (T196125) php-memcached 3.0 (provided with PHP 7.0) is now supported. * (T182366) UploadBase::checkXMLEncodingMissmatch() now works on PHP 7.1+ +* (T118683) Fix exception from &$user deref on HHVM in the TitleMoveComplete hook. === Changes since MediaWiki 1.31.0-rc.0 === * (T33223) Drop archive.ar_text and ar_flags. diff --git a/includes/MovePage.php b/includes/MovePage.php index fc9f6a6676..1e9570d2f7 100644 --- a/includes/MovePage.php +++ b/includes/MovePage.php @@ -415,7 +415,9 @@ class MovePage { new AtomicSectionUpdate( $dbw, __METHOD__, - function () use ( $params ) { + // Hold onto $user to avoid HHVM bug where it no longer + // becomes a reference (T118683) + function () use ( $params, &$user ) { Hooks::run( 'TitleMoveComplete', $params ); } )