Changeset 1686


Ignore:
Timestamp:
Dec 31, 2006, 6:02:36 PM (17 years ago)
Author:
rub
Message:

Issue ID 0000529 Fixed.

Problem with $_SERVERSCRIPT_FILENAME on IIS server

Location:
branches/branch-1_6/include
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/branch-1_6/include/common.inc.php

    r1572 r1686  
    175175
    176176if ($user['is_the_guest'] and !$conf['guest_access']
    177     and !in_array( basename($_SERVER['SCRIPT_FILENAME']),
     177    and !in_array( script_basename(),
    178178                      array('identification.php',
    179179                            'password.php',
  • branches/branch-1_6/include/functions.inc.php

    r1572 r1686  
    968968  }
    969969}
     970
     971/**
     972 * Return basename of the current script
     973 * Return value are chnage to loawer case
     974 *
     975 * @param void
     976 *
     977 * @return script basename
     978 */
     979function script_basename()
     980{
     981  if (!empty($_SERVER['SCRIPT_NAME']))
     982  {
     983    $file_name = $_SERVER['SCRIPT_NAME'];
     984  }
     985  else if (!empty($_SERVER['PHP_SELF']))
     986  {
     987    $file_name = $_SERVER['PHP_SELF'];
     988  }
     989  else if (!empty($_SERVER['SCRIPT_FILENAME']))
     990  {
     991    $file_name = $_SERVER['SCRIPT_FILENAME'];
     992  }
     993  else if (!empty($_SERVER['PATH_TRANSLATED']))
     994  {
     995    $file_name = $_SERVER['PATH_TRANSLATED'];
     996  }
     997  else
     998  {
     999    $file_name = '';
     1000  }
     1001
     1002  // $_SERVER return lower string following var ans systems
     1003  return basename(strtolower($file_name));
     1004}
     1005
    9701006?>
  • branches/branch-1_6/include/functions_calendar.inc.php

    r1162 r1686  
    178178
    179179  $must_show_list = true; // true until calendar generates its own display
    180   if (basename($_SERVER['SCRIPT_FILENAME']) != 'picture.php')
     180  if (script_basename() != 'picture.php')
    181181  {
    182182    $template->assign_block_vars('calendar', array());
  • branches/branch-1_6/include/section_init.inc.php

    r1372 r1686  
    8787
    8888$next_token = 0;
    89 if (basename($_SERVER['SCRIPT_FILENAME']) == 'picture.php')
     89if (script_basename() == 'picture.php')
    9090{ // the first token must be the identifier for the picture
    9191  if ( isset($_GET['image_id'])
     
    626626$page['cat_nb_images'] = isset($page['items']) ? count($page['items']) : 0;
    627627
    628 if (basename($_SERVER['SCRIPT_FILENAME']) == 'picture.php'
     628if (script_basename() == 'picture.php'
    629629    and !isset($page['image_id']) )
    630630{
Note: See TracChangeset for help on using the changeset viewer.