Don't cache pages with DB errors.
git-svn-id: http://svn.automattic.com/wordpress/trunk@1865 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
88efcfd20d
commit
f4dcbb2a3b
|
@ -67,6 +67,9 @@ function StaticizeCallback($buffer) {
|
||||||
return $buffer;
|
return $buffer;
|
||||||
endif;
|
endif;
|
||||||
|
|
||||||
|
if ( strstr($buffer, 'wpdberror') )
|
||||||
|
return $buffer;
|
||||||
|
|
||||||
$fr = fopen(CACHE_PATH . $staticFileName, 'a');
|
$fr = fopen(CACHE_PATH . $staticFileName, 'a');
|
||||||
chmod(CACHE_PATH . $staticFileName, 0666);
|
chmod(CACHE_PATH . $staticFileName, 0666);
|
||||||
if (!$fr)
|
if (!$fr)
|
||||||
|
@ -141,7 +144,7 @@ function staticize_header() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(function_exists('add_action')) {
|
if( function_exists('add_action') ) {
|
||||||
StaticizeInit();
|
StaticizeInit();
|
||||||
|
|
||||||
add_action('publish_post', 'postChange', 0);
|
add_action('publish_post', 'postChange', 0);
|
||||||
|
|
|
@ -93,7 +93,7 @@ class wpdb {
|
||||||
if ( $this->show_errors ) {
|
if ( $this->show_errors ) {
|
||||||
// If there is an error then take note of it
|
// If there is an error then take note of it
|
||||||
print "<div id='error'>
|
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>
|
<code>$this->last_query</code></p>
|
||||||
</div>";
|
</div>";
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue