summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael de Camargo <rafacamargo123@gmail.com>2019-08-03 22:28:04 -0300
committerFrédéric Guillot <fred@kanboard.net>2019-08-03 19:51:50 -0700
commitac829d4f148784581092c371cad1f48f6b40b13a (patch)
treec1bf71e3e490f25babb30ea191454678ddcd2b43
parent355de9fb455241adf1ac19346140bc3e3748906a (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
-rw-r--r--app/functions.php2
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");