Prevent fatal error when directory does not exist
This commit is contained in:
parent
68be4a5f65
commit
3d92fb099f
@ -289,6 +289,7 @@ function serendipity_killPlugin($name) {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
function serendipity_removeDeadFiles_SPL($dir=null, $deadfiles=null, $purgedir=null, $list_only=false) {
|
function serendipity_removeDeadFiles_SPL($dir=null, $deadfiles=null, $purgedir=null, $list_only=false) {
|
||||||
|
if (!is_dir($dir)) return;
|
||||||
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir), RecursiveIteratorIterator::CHILD_FIRST);
|
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($dir), RecursiveIteratorIterator::CHILD_FIRST);
|
||||||
$search = array("\\", '//');
|
$search = array("\\", '//');
|
||||||
$replace = array('/');
|
$replace = array('/');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user