Don't cache pages with DB errors.

git-svn-id: https://develop.svn.wordpress.org/trunk@1865 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Matt Mullenweg 2004-11-19 02:18:23 +00:00
parent 4ef178d2e0
commit fb26f2cb34
2 changed files with 5 additions and 2 deletions

View File

@ -67,6 +67,9 @@ function StaticizeCallback($buffer) {
return $buffer;
endif;
if ( strstr($buffer, 'wpdberror') )
return $buffer;
$fr = fopen(CACHE_PATH . $staticFileName, 'a');
chmod(CACHE_PATH . $staticFileName, 0666);
if (!$fr)
@ -141,7 +144,7 @@ function staticize_header() {
}
}
if(function_exists('add_action')) {
if( function_exists('add_action') ) {
StaticizeInit();
add_action('publish_post', 'postChange', 0);

View File

@ -93,7 +93,7 @@ class wpdb {
if ( $this->show_errors ) {
// If there is an error then take note of it
print "<div id='error'>
<p><strong>Database error:</strong> [$str]<br />
<p class='wpdberror'><strong>WordPress database error:</strong> [$str]<br />
<code>$this->last_query</code></p>
</div>";
} else {