Changeset 3465
- Timestamp:
- 01/19/2006 10:12:15 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/cache.php
r3462 r3465 236 236 $top_dir = $dir; 237 237 $stack = array($dir); 238 239 while (count($stack)) { 240 # Get last directory on stack 241 $dir = end($stack); 238 $index = 0; 239 240 while ($index < count($stack)) { 241 # Get indexed directory from stack 242 $dir = $stack[$index]; 242 243 243 244 $dh = @ opendir($dir); … … 248 249 if ($file == '.' or $file == '..') 249 250 continue; 250 251 251 252 if (@ is_dir($dir . DIRECTORY_SEPARATOR . $file)) 252 253 $stack[] = $dir . DIRECTORY_SEPARATOR . $file; … … 255 256 } 256 257 257 if (end($stack) == $dir) { 258 if ( $dir != $top_dir) 259 @ rmdir($dir); 260 array_pop($stack); 261 } 262 } 258 $index++; 259 } 260 261 $stack = array_reverse($stack); // Last added dirs are deepest 262 foreach($stack as $dir) { 263 if ( $dir != $top_dir) 264 @ rmdir($dir); 265 } 266 263 267 } 264 268 … … 404 408 $this->cache_dir = CACHE_PATH; 405 409 else 406 $this->cache_dir = ABSPATH.'wp-content/cache/'; 410 // Using the correct separator eliminates some cache flush errors on Windows 411 $this->cache_dir = ABSPATH.'wp-content'.DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR; 407 412 408 413 if (is_writable($this->cache_dir) && is_dir($this->cache_dir)) {
Note: See TracChangeset
for help on using the changeset viewer.