Fix missing folder

This commit is contained in:
Knah Tsaeb 2019-11-13 12:08:51 +01:00
parent 697d5fea2d
commit 44703f20a4
2 changed files with 384 additions and 375 deletions

View File

@ -42,7 +42,8 @@ if (!function_exists('exif_read_data') && $display_exif == 1) {
//-----------------------
// FUNCTIONS
//-----------------------
function padstring($name, $length) {
function padstring($name, $length)
{
global $label_max_length;
if (!isset($length)) {
$length = $label_max_length;
@ -53,7 +54,8 @@ function padstring($name, $length) {
return $name;
}
function getfirstImage($dirname) {
function getfirstImage($dirname)
{
$imageName = false;
$extensions = array("jpg", "png", "jpeg", "gif");
if ($handle = opendir($dirname)) {
@ -76,7 +78,8 @@ function getfirstImage($dirname) {
return $imageName;
}
function parse_fraction($v, $round = 0) {
function parse_fraction($v, $round = 0)
{
list($x, $y) = array_map('intval', explode('/', $v));
if (empty($x) || empty($y)) {
return $v;
@ -90,7 +93,8 @@ function parse_fraction($v, $round = 0) {
return round($x / $y, $round);
}
function readEXIF($file) {
function readEXIF($file)
{
$exif_arr = array();
$exif_data = exif_read_data($file);
@ -126,7 +130,8 @@ function readEXIF($file) {
return $exif_arr;
}
function checkpermissions($file) {
function checkpermissions($file)
{
global $messages;
if (!is_readable($file)) {
@ -137,7 +142,8 @@ function checkpermissions($file) {
}
}
function guardAgainstDirectoryTraversal($path) {
function guardAgainstDirectoryTraversal($path)
{
$pattern = "/^(.*\/)?(\.\.)(\/.*)?$/";
$directory_traversal = preg_match($pattern, $path);
@ -183,7 +189,10 @@ if (is_dir($current_dir) && $handle = opendir($current_dir)) {
fclose($caption_handle);
}
while (false !== ($file = readdir($handle)) && !in_array($file, $skip_objects)) {
while (false !== ($file = readdir($handle))) {
if (in_array($file, $skip_objects)) {
continue;
}
// 2. LOAD FOLDERS
if (is_dir($current_dir . "/" . $file)) {
if ($file != "." && $file != "..") {

View File

@ -140,8 +140,8 @@
<script src="<% gallery_root %>js/lazy.js"></script>
<script src="<% gallery_root %>js/script.js"></script>
<script src="<% gallery_root %>js/mootools.js"></script>
<script src="<% gallery_root %>js/mediabox1.3.4.js"></script>
<script src="<% gallery_root %>js/mootools1.5.0.js"></script>
<script src="<% gallery_root %>js/mediabox1.5.4.js"></script>
</head>
<body>
<header id="top" role="banner">