From 437422ac9d0e4aca3d903814f02da96977ccc3e1 Mon Sep 17 00:00:00 2001 From: Piotr KUCHARSKI Date: Wed, 26 Nov 2014 18:43:29 +0100 Subject: [PATCH] use built-in is_readable() --- index.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) mode change 100644 => 100755 index.php diff --git a/index.php b/index.php old mode 100644 new mode 100755 index eceef16..0408ab0 --- a/index.php +++ b/index.php @@ -123,8 +123,13 @@ function readEXIF($file) function checkpermissions($file) { global $messages; - if (substr(decoct(fileperms($file)), -1, strlen(fileperms($file))) < 4 OR substr(decoct(fileperms($file)), -3, 1) < 4) - $messages = "At least one file or folder has wrong permissions. Learn how to set file permissions"; + + if (!is_readable($file)) { + $messages = "At least one file or folder has wrong permissions. " + . "Learn how to " + . "set file permissions"; + } } if (!defined("GALLERY_ROOT"))