Skip to content
Permalink
Browse files

Helper::purge() protection (#392)

  • Loading branch information...
dg committed Feb 20, 2019
1 parent 025d1ce commit 359ddb1aec4da27172335cbc78822c5b120cc305
Showing with 3 additions and 0 deletions.
  1. +3 βˆ’0 src/Framework/Helpers.php
@@ -20,6 +20,9 @@ class Helpers
*/
public static function purge(string $dir): void
{
if (preg_match('#^(\w:)?[/\\\\]?$#', $dir)) {
throw new \InvalidArgumentException('Directory must not be an empty string or root path.');
}
if (!is_dir($dir)) {
mkdir($dir);
}

0 comments on commit 359ddb1

Please sign in to comment.
You can’t perform that action at this time.