From 53d6690c3ca3ce6981d0616e8ba7940f391d93f5 Mon Sep 17 00:00:00 2001
From: Alan Nelson <alan.nelson@nebraska.edu>
Date: Thu, 12 Sep 2019 20:24:23 +0000
Subject: [PATCH] Fix a bug linting files with spaces in the name

---
 php-lint/php-lint | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/php-lint/php-lint b/php-lint/php-lint
index afb52f2..c14a4f3 100644
--- a/php-lint/php-lint
+++ b/php-lint/php-lint
@@ -51,8 +51,8 @@ for dir in "${LINT_DIRS[@]}"; do
     echo "Scanning directory ${dir} for extension ${ext}"
 
     # Scan current dir and ext and lint them
-    for f in $(find "${dir}" -type f -name "*${ext}"); do
-      OUTPUT=$(php -l $f 2>&1)
+    find "${dir}" -type f -name "*${ext}" -print0 | while IFS= read -r -d '' f; do
+      OUTPUT=$(php -l "$f" 2>&1)
       rc=$?
 
       if [[ $rc != 0 ]]; then # Non-zero exit code, print error and exit
-- 
GitLab