X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FAjaxResponse.php;h=ac8a9f097d2ef6560b17f7230d0db2273aaac16b;hb=7110eb061a03b517b66c34017be2998a8979adfa;hp=138f808a0323ae5b34cbfa05d81f1beb6ba93940;hpb=dac3d8d7f28059ba7b30b4b74a5c0ec575c5854a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/AjaxResponse.php b/includes/AjaxResponse.php index 138f808a03..ac8a9f097d 100644 --- a/includes/AjaxResponse.php +++ b/includes/AjaxResponse.php @@ -210,7 +210,7 @@ class AjaxResponse { * @param $timestamp string * @return bool Returns true if the response code was set to 304 Not Modified. */ - function checkLastModified ( $timestamp ) { + function checkLastModified( $timestamp ) { global $wgCachePages, $wgCacheEpoch, $wgUser; $fname = 'AjaxResponse::checkLastModified'; @@ -220,12 +220,7 @@ class AjaxResponse { } if ( !$wgCachePages ) { - wfDebug( "$fname: CACHE DISABLED\n", false ); - return false; - } - - if ( $wgUser->getOption( 'nocache' ) ) { - wfDebug( "$fname: USER DISABLED CACHE\n", false ); + wfDebug( "$fname: CACHE DISABLED\n", 'log' ); return false; } @@ -239,8 +234,8 @@ class AjaxResponse { $modsince = preg_replace( '/;.*$/', '', $_SERVER["HTTP_IF_MODIFIED_SINCE"] ); $modsinceTime = strtotime( $modsince ); $ismodsince = wfTimestamp( TS_MW, $modsinceTime ? $modsinceTime : 1 ); - wfDebug( "$fname: -- client send If-Modified-Since: " . $modsince . "\n", false ); - wfDebug( "$fname: -- we might send Last-Modified : $lastmod\n", false ); + wfDebug( "$fname: -- client send If-Modified-Since: " . $modsince . "\n", 'log' ); + wfDebug( "$fname: -- we might send Last-Modified : $lastmod\n", 'log' ); if ( ( $ismodsince >= $timestamp ) && $wgUser->validateCache( $ismodsince ) && $ismodsince >= $wgCacheEpoch ) { ini_set( 'zlib.output_compression', 0 ); @@ -248,15 +243,15 @@ class AjaxResponse { $this->disable(); $this->mLastModified = $lastmod; - wfDebug( "$fname: CACHED client: $ismodsince ; user: {$wgUser->getTouched()} ; page: $timestamp ; site $wgCacheEpoch\n", false ); + wfDebug( "$fname: CACHED client: $ismodsince ; user: {$wgUser->getTouched()} ; page: $timestamp ; site $wgCacheEpoch\n", 'log' ); return true; } else { - wfDebug( "$fname: READY client: $ismodsince ; user: {$wgUser->getTouched()} ; page: $timestamp ; site $wgCacheEpoch\n", false ); + wfDebug( "$fname: READY client: $ismodsince ; user: {$wgUser->getTouched()} ; page: $timestamp ; site $wgCacheEpoch\n", 'log' ); $this->mLastModified = $lastmod; } } else { - wfDebug( "$fname: client did not send If-Modified-Since header\n", false ); + wfDebug( "$fname: client did not send If-Modified-Since header\n", 'log' ); $this->mLastModified = $lastmod; } return false;