Skip to content

Commit

Permalink
Improve comments; see #197
Browse files Browse the repository at this point in the history
  • Loading branch information
JasWSInc committed Jun 18, 2014
1 parent 60fa420 commit 466fe4a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions quick-cache/includes/advanced-cache.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -870,11 +870,12 @@ public function output_buffer_callback_handler($buffer, $phase)
if($this->is_404 && !QUICK_CACHE_CACHE_404_REQUESTS) // Not caching 404 errors.
return (boolean)$this->maybe_set_debug_info($this::NC_DEBUG_404_REQUEST);

if(strpos($cache, '<body id="error-page">') !== FALSE)
if(strpos($cache, '<body id="error-page">') !== FALSE) // A WordPress-generated {@link \wp_die()} error?
return (boolean)$this->maybe_set_debug_info($this::NC_DEBUG_WP_ERROR_PAGE);

if(!$this->function_is_possible('http_response_code') && stripos($cache, '<title>database error</title>') !== FALSE)
return (boolean)$this->maybe_set_debug_info($this::NC_DEBUG_WP_ERROR_PAGE);
if(!$this->function_is_possible('http_response_code')) // Unable to reliably detect HTTP status code?
if(stripos($cache, '<title>database error</title>') !== FALSE) // Fallback on this hackety hack.
return (boolean)$this->maybe_set_debug_info($this::NC_DEBUG_WP_ERROR_PAGE);

if(!$this->has_a_cacheable_content_type()) // Exclude non-HTML/XML content types.
return (boolean)$this->maybe_set_debug_info($this::NC_DEBUG_UNCACHEABLE_CONTENT_TYPE);
Expand Down

0 comments on commit 466fe4a

Please sign in to comment.