Merge pull request #76 from bifek/tinyfixes

use built-in is_readable()
This commit is contained in:
Tom.C. 2014-11-26 18:49:47 +01:00
commit bed64ca78a

9
index.php Normal file → Executable file
View file

@ -123,8 +123,13 @@ function readEXIF($file)
function checkpermissions($file) function checkpermissions($file)
{ {
global $messages; 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")) if (!defined("GALLERY_ROOT"))