use built-in is_readable()

This commit is contained in:
Piotr KUCHARSKI 2014-11-26 18:43:29 +01:00
parent a57b081377
commit 437422ac9d

9
index.php Normal file → Executable file
View file

@ -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 <a href='http://minigal.dk/faq-reader/items/how-do-i-change-file-permissions-chmod.html' target='_blank'>set file permissions</a>";
if (!is_readable($file)) {
$messages = "At least one file or folder has wrong permissions. "
. "Learn how to <a href='http://minigal.dk/faq-reader/items/"
. "how-do-i-change-file-permissions-chmod.html' target='_blank'>"
. "set file permissions</a>";
}
}
if (!defined("GALLERY_ROOT"))