diff options
author | Rafael de Camargo <rafacamargo123@gmail.com> | 2019-08-03 22:28:04 -0300 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2019-08-03 19:51:50 -0700 |
commit | ac829d4f148784581092c371cad1f48f6b40b13a (patch) | |
tree | c1bf71e3e490f25babb30ea191454678ddcd2b43 /app/functions.php | |
parent | 355de9fb455241adf1ac19346140bc3e3748906a (diff) |
Add error checks to glob function
GLOB_ERR will throw errors if an error occurs,
such as lack of permission
GLOB_NOCHECK will return the pattern if no file
is found, this makes the file_exists check valid
Diffstat (limited to 'app/functions.php')
-rw-r--r-- | app/functions.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/functions.php b/app/functions.php index ada96d97..e5b2977b 100644 --- a/app/functions.php +++ b/app/functions.php @@ -6,7 +6,7 @@ function concat_files(array $files) { $data = ''; foreach ($files as $pattern) { - foreach (glob($pattern) as $filename) { + foreach (glob($pattern, GLOB_ERR | GLOB_NOCHECK) as $filename) { echo $filename.PHP_EOL; if (! file_exists($filename)) { die("$filename not found\n"); |