projects
/
bizou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cbbc240
)
Minor comments changes
author
Marc MAURICE
<dooblempub@positon.org>
Sun, 12 Dec 2010 21:52:03 +0000
(22:52 +0100)
committer
Marc MAURICE
<dooblempub@positon.org>
Sun, 12 Dec 2010 21:52:03 +0000
(22:52 +0100)
index.php
patch
|
blob
|
history
diff --git
a/index.php
b/index.php
index
c20a4dc
..
2f66ac7
100644
(file)
--- a/
index.php
+++ b/
index.php
@@
-80,15
+80,17
@@
function getAlbumPreview($dir)
$scriptUrlPath = $_SERVER["SCRIPT_NAME"];
$scriptUrlPath = $_SERVER["SCRIPT_NAME"];
-// if url == http://localhost/photos/index/toto/titi, path_info == /toto/titi
-// if url == http://localhost/photos/index, path_info is not set
+// if url == http://localhost/photos/index.php/toto/titi, path_info == /toto/titi
+// if url == http://localhost/photos/index.php, path_info is not set
// if url == http://localhost/photos/, path_info is not set
// if url == http://localhost/photos/, path_info is not set
-// if path_info is not set, we are at top level, so we redirect to /photos/index/
+// if path_info is not set, we are at top level, so we redirect to /photos/index.php/
if (! isset($_SERVER["PATH_INFO"])) {
header("Location: $scriptUrlPath/");
exit();
}
if (! isset($_SERVER["PATH_INFO"])) {
header("Location: $scriptUrlPath/");
exit();
}
+# shortPath is the simple path to the image
+# /index.php/toto/titi => shortPath == /toto/titi
$shortPath = $_SERVER["PATH_INFO"];
if ($shortPath == '/') $shortPath = '';
// extra security check to avoid /photos/index/../.. like urls, maybe useless but..
$shortPath = $_SERVER["PATH_INFO"];
if ($shortPath == '/') $shortPath = '';
// extra security check to avoid /photos/index/../.. like urls, maybe useless but..
@@
-98,6
+100,8
@@
$folders = array();
$imageFiles = array();
$otherFiles = array();
$imageFiles = array();
$otherFiles = array();
+# realDir is the directory in filesystem
+# seen from current script directory
$realDir = IMAGES_DIR.$shortPath;
if (! is_dir($realDir)) {
$realDir = IMAGES_DIR.$shortPath;
if (! is_dir($realDir)) {