Prevent error in files_trashbin
`glob` can return FALSE when the directory is empty, instead of an empty array, causing an error at `foreach`. "Note: On some systems it is impossible to distinguish between empty match and an error." See http://www.php.net/manual/en/function.glob.php -> Return Values
This commit is contained in:
parent
fa8814902e
commit
869e7a51f0
1 changed files with 9 additions and 7 deletions
|
@ -824,6 +824,7 @@ class Trashbin {
|
|||
$matches = glob($escapedVersionsName . '*');
|
||||
}
|
||||
|
||||
if (is_array($matches)) {
|
||||
foreach ($matches as $ma) {
|
||||
if ($timestamp) {
|
||||
$parts = explode('.v', substr($ma, 0, $offset));
|
||||
|
@ -833,6 +834,7 @@ class Trashbin {
|
|||
$versions[] = (end($parts));
|
||||
}
|
||||
}
|
||||
}
|
||||
return $versions;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue