IteratorIteratorIteratorIterator iterated iteration fix. To understand iteration, you first need to understand recursion and iteration and iteration and iteration and iteration.
This commit is contained in:
parent
b8897b3250
commit
7832c364d7
@ -2,6 +2,8 @@
|
||||
Version 2.1-rc2 | final ()
|
||||
------------------------------------------------------------------------
|
||||
|
||||
* Some more PHP7 error catching
|
||||
|
||||
* Fix missing token when updating plugin
|
||||
|
||||
* Fix missing variable name in regular expression match, Issue #442
|
||||
|
@ -1161,7 +1161,7 @@ function serendipity_smarty_purge() {
|
||||
|
||||
serendipity_smarty_init(); # need initiated smarty to get the compile/cache dir
|
||||
$dir = new RecursiveDirectoryIterator($serendipity['smarty']->getCompileDir());
|
||||
$ite = new RecursiveIteratorIterator($dir);
|
||||
$ite = new RecursiveIteratorIterator($dir, RecursiveIteratorIterator::LEAVES_ONLY, RecursiveIteratorIterator::CATCH_GET_CHILD);
|
||||
$files = new RegexIterator($ite, '@.*\.tpl\.php$@', RegexIterator::GET_MATCH);
|
||||
foreach($files as $file) {
|
||||
if (is_writable($file[0])) {
|
||||
|
@ -334,7 +334,7 @@ function serendipity_removeDeadFiles_SPL($dir=null, $deadfiles=null, $purgedir=n
|
||||
} catch (Exception $e) {
|
||||
return;
|
||||
}
|
||||
$iterator = new RecursiveIteratorIterator($_dir, RecursiveIteratorIterator::CHILD_FIRST);
|
||||
$iterator = new RecursiveIteratorIterator($_dir, RecursiveIteratorIterator::CHILD_FIRST, RecursiveIteratorIterator::CATCH_GET_CHILD);
|
||||
$search = array("\\", '//');
|
||||
$replace = array('/');
|
||||
foreach ($iterator as $file) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user