Suppress fopen warnings and check return.
git-svn-id: http://svn.automattic.com/wordpress/trunk@3170 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
51b8a36906
commit
6628bfcf35
|
@ -302,7 +302,9 @@ class WP_Object_Cache {
|
||||||
|
|
||||||
$temp_file = tempnam($group_dir, 'tmp');
|
$temp_file = tempnam($group_dir, 'tmp');
|
||||||
$serial = CACHE_SERIAL_HEADER.serialize($this->cache[$group][$id]).CACHE_SERIAL_FOOTER;
|
$serial = CACHE_SERIAL_HEADER.serialize($this->cache[$group][$id]).CACHE_SERIAL_FOOTER;
|
||||||
$fd = fopen($temp_file, 'w');
|
$fd = @fopen($temp_file, 'w');
|
||||||
|
if ( false === $fd )
|
||||||
|
continue;
|
||||||
fputs($fd, $serial);
|
fputs($fd, $serial);
|
||||||
fclose($fd);
|
fclose($fd);
|
||||||
if (!@ rename($temp_file, $cache_file)) {
|
if (!@ rename($temp_file, $cache_file)) {
|
||||||
|
|
Loading…
Reference in New Issue