Skip to content

Commit

Permalink
Issue ID 0000529 Re-Fixed.
Browse files Browse the repository at this point in the history
Problem with "Options +MultiViews" .htaccess configuration.

Merge branch-1_6 1688:1689 into BSF

git-svn-id: http://piwigo.org/svn/trunk@1690 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
rub committed Jan 2, 2007
1 parent 0f2b554 commit 481188f
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 21 deletions.
7 changes: 4 additions & 3 deletions include/common.inc.php
Expand Up @@ -178,9 +178,10 @@

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'
)
)
)
Expand Down
9 changes: 5 additions & 4 deletions include/config_default.inc.php
Expand Up @@ -570,12 +570,13 @@
// +-----------------------------------------------------------------------+
// 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'
);

?>
15 changes: 4 additions & 11 deletions include/functions.inc.php
Expand Up @@ -1111,7 +1111,8 @@ function load_conf_from_db()

/**
* 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
*
Expand All @@ -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');
}

?>
2 changes: 1 addition & 1 deletion include/functions_calendar.inc.php
Expand Up @@ -186,7 +186,7 @@ function initialize_calendar()
//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());

Expand Down
4 changes: 2 additions & 2 deletions include/section_init.inc.php
Expand Up @@ -86,7 +86,7 @@
// );

$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']) )
Expand Down Expand Up @@ -706,7 +706,7 @@

$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']) )
Expand Down

0 comments on commit 481188f

Please sign in to comment.