Index: core/kernel/managers/rewrite_url_processor.php =================================================================== --- core/kernel/managers/rewrite_url_processor.php (revision 15374) +++ core/kernel/managers/rewrite_url_processor.php (working copy) @@ -233,7 +233,7 @@ */ protected function _getCachedUrl($url) { - if (!$url) { + if ( !$url || (defined('DBG_CACHE_URLS') && !DBG_CACHE_URLS) ) { return false; } @@ -242,9 +242,9 @@ WHERE Hash = ' . kUtil::crc32($url) . ' AND DomainId = ' . (int)$this->Application->siteDomainField('DomainId'); $data = $this->Conn->GetRow($sql); - if ($data) { + if ( $data ) { $lifetime = (int)$data['LifeTime']; // in seconds - if (($lifetime > 0) && ($data['Cached'] + $lifetime < adodb_mktime())) { + if ( ($lifetime > 0) && ($data['Cached'] + $lifetime < TIMENOW) ) { // delete expired $sql = 'DELETE FROM ' . TABLE_PREFIX . 'CachedUrls WHERE UrlId = ' . $data['UrlId']; @@ -269,8 +269,8 @@ */ protected function _setCachedUrl($url, $data) { - if (!$url) { - return ; + if ( !$url || (defined('DBG_CACHE_URLS') && !DBG_CACHE_URLS) ) { + return; } $vars = $data['vars']; @@ -278,7 +278,7 @@ sort($passed); // get expiration - if ($vars['m_cat_id'] > 0) { + if ( $vars['m_cat_id'] > 0 ) { $sql = 'SELECT PageExpiration FROM ' . TABLE_PREFIX . 'Categories WHERE CategoryId = ' . $vars['m_cat_id']; @@ -289,10 +289,10 @@ $prefixes = Array (); $m_index = array_search('m', $passed); - if ($m_index !== false) { + if ( $m_index !== false ) { unset($passed[$m_index]); - if ($vars['m_cat_id'] > 0) { + if ( $vars['m_cat_id'] > 0 ) { $prefixes[] = 'c:' . $vars['m_cat_id']; } @@ -301,7 +301,7 @@ } foreach ($passed as $prefix) { - if (array_key_exists($prefix . '_id', $vars) && is_numeric($vars[$prefix . '_id'])) { + if ( array_key_exists($prefix . '_id', $vars) && is_numeric($vars[$prefix . '_id']) ) { $prefixes[] = $prefix . ':' . $vars[$prefix . '_id']; } else { Index: tools/debug_sample.php =================================================================== --- tools/debug_sample.php (revision 15331) +++ tools/debug_sample.php (working copy) @@ -55,4 +55,5 @@ // 'DBG_IMAGE_RECOVERY' => 1, // Don't replace missing images with noimage.gif // 'DBG_SQL_MODE' => 'TRADITIONAL', // Extra control over sql syntax & data from MySQL server side // 'DBG_RESET_ROOT' => 1, // Shows "root" user password reset link on Admin Console login screen +// 'DBG_CACHE_URLS' => 0, // Cache urls, that are build by rewrite listeners ); \ No newline at end of file