[contents.php] Fix logical error in getSimpleHTMLDOMCached function (#1974)

Previously content was only loaded from cache when debug mode was enabled (the opposite of the expected behavior)
This commit is contained in:
Thomas 2021-02-09 13:40:16 +01:00 committed by GitHub
parent 809343ed06
commit 771b851b52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -311,7 +311,7 @@ function getSimpleHTMLDOMCached($url,
$time = $cache->getTime(); $time = $cache->getTime();
if($time !== false if($time !== false
&& (time() - $duration < $time) && (time() - $duration < $time)
&& Debug::isEnabled()) { // Contents within duration && !Debug::isEnabled()) { // Contents within duration
$content = $cache->loadData(); $content = $cache->loadData();
} else { // Content not within duration } else { // Content not within duration
$content = getContents($url, $header, $opts); $content = getContents($url, $header, $opts);