From: Brad Jorsch Date: Tue, 19 Feb 2019 20:54:33 +0000 (-0500) Subject: DifferenceEngine: Allow cache hits for empty diffs X-Git-Tag: 1.34.0-rc.0~2772^2 X-Git-Url: http://git.cyclocoop.org/%22%2C%20generer_url_ecrire%28?a=commitdiff_plain;h=02195c7a817aa381c526ca71fbdeeea88e7302dd;p=lhc%2Fweb%2Fwiklou.git DifferenceEngine: Allow cache hits for empty diffs PHP considers the empty string as falsey, so check for a string result instead. Bug: T216554 Change-Id: I3b7d1199acbfede8a95761c5cb1c797b9a3d64cb --- diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index 43bc6e470c..87863a4c12 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -1033,7 +1033,7 @@ class DifferenceEngine extends ContextSource { // Try cache if ( !$this->mRefreshCache ) { $difftext = $cache->get( $key ); - if ( $difftext ) { + if ( is_string( $difftext ) ) { wfIncrStats( 'diff_cache.hit' ); $difftext = $this->localiseDiff( $difftext ); $difftext .= "\n\n";