aboutsummaryrefslogtreecommitdiffstats
path: root/include/functions.inc.php
diff options
context:
space:
mode:
authorrub <rub@piwigo.org>2006-12-31 17:08:37 +0000
committerrub <rub@piwigo.org>2006-12-31 17:08:37 +0000
commit9c914a2b6659c58b5648fbd05c6fcedb2f2a808e (patch)
tree769ccc4eb8b60e870d6486153fd8ba4b0e3f9dcd /include/functions.inc.php
parent48879ca17794cb929b0a999a02d39041a7687ca6 (diff)
Issue ID 0000529 Fixed.
Problem with $_SERVER['SCRIPT_FILENAME'] on IIS server Merge branch-1_6 1685:1686 into BSF git-svn-id: http://piwigo.org/svn/trunk@1687 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/functions.inc.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/include/functions.inc.php b/include/functions.inc.php
index f9fbaf88f..e5d26f63e 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -1108,4 +1108,40 @@ SELECT param,value
}
}
}
+
+/**
+ * Return basename of the current script
+ * Return value are chnage to loawer case
+ *
+ * @param void
+ *
+ * @return script basename
+ */
+function script_basename()
+{
+ if (!empty($_SERVER['SCRIPT_NAME']))
+ {
+ $file_name = $_SERVER['SCRIPT_NAME'];
+ }
+ else if (!empty($_SERVER['PHP_SELF']))
+ {
+ $file_name = $_SERVER['PHP_SELF'];
+ }
+ else if (!empty($_SERVER['SCRIPT_FILENAME']))
+ {
+ $file_name = $_SERVER['SCRIPT_FILENAME'];
+ }
+ else if (!empty($_SERVER['PATH_TRANSLATED']))
+ {
+ $file_name = $_SERVER['PATH_TRANSLATED'];
+ }
+ else
+ {
+ $file_name = '';
+ }
+
+ // $_SERVER return lower string following var ans systems
+ return basename(strtolower($file_name));
+}
+
?>