X-Git-Url: https://git.cyclocoop.org/admin/?a=blobdiff_plain;f=includes%2Fdiff%2FDifferenceEngine.php;h=5367199f2f33495c015e48ab9afd533122517cc9;hb=62a7b9cd3dcea2c0d9d4393a034ec7b9533f934f;hp=559a5ec667cfa9db118450d254a5cfc9c5eb9787;hpb=f9e21f91e459c40fed6d8f2e76cccbce07e2ba1b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index 559a5ec667..5367199f2f 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -762,8 +762,11 @@ class DifferenceEngine extends ContextSource { $difftext = $this->generateContentDiffBody( $this->mOldContent, $this->mNewContent ); + // Avoid PHP 7.1 warning from passing $this by reference + $diffEngine = $this; + // Save to cache for 7 days - if ( !Hooks::run( 'AbortDiffCache', [ &$this ] ) ) { + if ( !Hooks::run( 'AbortDiffCache', [ &$diffEngine ] ) ) { wfIncrStats( 'diff_cache.uncacheable' ); } elseif ( $key !== false && $difftext !== false ) { wfIncrStats( 'diff_cache.miss' ); @@ -982,7 +985,7 @@ class DifferenceEngine extends ContextSource { public function localiseLineNumbers( $text ) { return preg_replace_callback( '//', - [ &$this, 'localiseLineNumbersCb' ], + [ $this, 'localiseLineNumbersCb' ], $text ); }