aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/common.inc.php7
-rw-r--r--include/config_default.inc.php9
-rw-r--r--include/functions.inc.php15
-rw-r--r--include/functions_calendar.inc.php2
-rw-r--r--include/section_init.inc.php4
5 files changed, 16 insertions, 21 deletions
diff --git a/include/common.inc.php b/include/common.inc.php
index e07f34a5b..d97a44b07 100644
--- a/include/common.inc.php
+++ b/include/common.inc.php
@@ -178,9 +178,10 @@ if ($conf['gallery_locked'])
if ($user['is_the_guest'] and !$conf['guest_access']
and !in_array( script_basename(),
- array('identification.php',
- 'password.php',
- 'register.php'
+ // Array of basename without file extention
+ array('identification',
+ 'password',
+ 'register'
)
)
)
diff --git a/include/config_default.inc.php b/include/config_default.inc.php
index f477fc267..2f61f5584 100644
--- a/include/config_default.inc.php
+++ b/include/config_default.inc.php
@@ -570,12 +570,13 @@ $conf['enable_plugins']=true;
// +-----------------------------------------------------------------------+
// Pages where filter is enabled
// Other pages cancel current filter
+// Array of basename without file extention
$conf['filter_pages'] = array
(
- 'about.php', 'action.php', 'admin.php', 'comments.php',
- 'index.php', 'picture.php', 'popuphelp.php', 'profile.php',
- 'qsearch.php', 'random.php', 'register.php', 'search.php',
- 'search_rules.php', 'tags.php', 'upload.php'
+ 'about', 'action', 'admin', 'comments',
+ 'index', 'picture', 'popuphelp', 'profile',
+ 'qsearch', 'random', 'register', 'search',
+ 'search_rules', 'tags', 'upload'
);
?>
diff --git a/include/functions.inc.php b/include/functions.inc.php
index e5d26f63e..3593652e0 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -1111,7 +1111,8 @@ SELECT param,value
/**
* Return basename of the current script
- * Return value are chnage to loawer case
+ * Lower case convertion is applied on return value
+ * Return value is without file extention ".php"
*
* @param void
*
@@ -1123,25 +1124,17 @@ function script_basename()
{
$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));
+ // $_SERVER return lower string following var and systems
+ return basename(strtolower($file_name), '.php');
}
?>
diff --git a/include/functions_calendar.inc.php b/include/functions_calendar.inc.php
index cca864218..0ee126f5e 100644
--- a/include/functions_calendar.inc.php
+++ b/include/functions_calendar.inc.php
@@ -186,7 +186,7 @@ WHERE id IN (' . implode(',',$page['items']) .')';
//echo ('<pre>'. var_export($calendar, true) . '</pre>');
$must_show_list = true; // true until calendar generates its own display
- if (script_basename() != 'picture.php')
+ if (script_basename() != 'picture') // basename without file extention
{
$template->assign_block_vars('calendar', array());
diff --git a/include/section_init.inc.php b/include/section_init.inc.php
index 622be2e07..29a5be5e8 100644
--- a/include/section_init.inc.php
+++ b/include/section_init.inc.php
@@ -86,7 +86,7 @@ $tokens = explode(
// );
$next_token = 0;
-if (script_basename() == 'picture.php')
+if (script_basename() == 'picture') // basename without file extention
{ // the first token must be the identifier for the picture
if ( isset($_GET['image_id'])
and isset($_GET['cat']) and is_numeric($_GET['cat']) )
@@ -706,7 +706,7 @@ if (isset($page['chronology_field']))
$page['cat_nb_images'] = isset($page['items']) ? count($page['items']) : 0;
-if (script_basename() == 'picture.php'
+if (script_basename() == 'picture'
and !isset($page['image_id']) )
{
if ( !empty($page['items']) )