1
0
Fork 0

Fail hard if anything attempts to wipe the entire filesystem/partition, fixes #2409

pull/2427/head
Jordi Boggiano 2013-11-14 21:21:08 +01:00
parent f94ec8dd09
commit dff5e3c542
1 changed files with 4 additions and 0 deletions

View File

@ -69,6 +69,10 @@ class Filesystem
return true; return true;
} }
if (preg_match('{^(?:[a-z]:)?[/\\\\]+$}i', $directory)) {
throw new \RuntimeException('Aborting an attempted deletion of '.$directory.', this was probably not intended, if it is a real use case please report it.');
}
if (!function_exists('proc_open')) { if (!function_exists('proc_open')) {
return $this->removeDirectoryPhp($directory); return $this->removeDirectoryPhp($directory);
} }