Changeset 1687 for trunk


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

Issue ID 0000529 Fixed.

Problem with $_SERVERSCRIPT_FILENAME on IIS server

Merge branch-1_6 1685:1686 into BSF

Location:
trunk/include
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/common.inc.php

    r1679 r1687  
    178178
    179179if ($user['is_the_guest'] and !$conf['guest_access']
    180     and !in_array( basename($_SERVER['SCRIPT_FILENAME']),
     180    and !in_array( script_basename(),
    181181                      array('identification.php',
    182182                            'password.php',
  • trunk/include/filter.inc.php

    r1685 r1687  
    3535
    3636$filter['enabled'] =
    37   (in_array(basename($_SERVER['SCRIPT_FILENAME']), $conf['filter_pages'])) and
     37  (in_array(script_basename(), $conf['filter_pages'])) and
    3838  (
    3939    (isset($_GET['filter']) and ($_GET['filter'] == 'start')) or
     
    4141  );
    4242
    43 if (in_array(basename($_SERVER['SCRIPT_FILENAME']), $conf['filter_pages']))
     43if (in_array(script_basename(), $conf['filter_pages']))
    4444{
    4545  if (isset($_GET['filter']))
  • trunk/include/functions.inc.php

    r1679 r1687  
    11091109  }
    11101110}
     1111
     1112/**
     1113 * Return basename of the current script
     1114 * Return value are chnage to loawer case
     1115 *
     1116 * @param void
     1117 *
     1118 * @return script basename
     1119 */
     1120function script_basename()
     1121{
     1122  if (!empty($_SERVER['SCRIPT_NAME']))
     1123  {
     1124    $file_name = $_SERVER['SCRIPT_NAME'];
     1125  }
     1126  else if (!empty($_SERVER['PHP_SELF']))
     1127  {
     1128    $file_name = $_SERVER['PHP_SELF'];
     1129  }
     1130  else if (!empty($_SERVER['SCRIPT_FILENAME']))
     1131  {
     1132    $file_name = $_SERVER['SCRIPT_FILENAME'];
     1133  }
     1134  else if (!empty($_SERVER['PATH_TRANSLATED']))
     1135  {
     1136    $file_name = $_SERVER['PATH_TRANSLATED'];
     1137  }
     1138  else
     1139  {
     1140    $file_name = '';
     1141  }
     1142
     1143  // $_SERVER return lower string following var ans systems
     1144  return basename(strtolower($file_name));
     1145}
     1146
    11111147?>
  • trunk/include/functions_calendar.inc.php

    r1677 r1687  
    187187
    188188  $must_show_list = true; // true until calendar generates its own display
    189   if (basename($_SERVER['SCRIPT_FILENAME']) != 'picture.php')
     189  if (script_basename() != 'picture.php')
    190190  {
    191191    $template->assign_block_vars('calendar', array());
  • trunk/include/section_init.inc.php

    r1681 r1687  
    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'])
     
    707707$page['cat_nb_images'] = isset($page['items']) ? count($page['items']) : 0;
    708708
    709 if (basename($_SERVER['SCRIPT_FILENAME']) == 'picture.php'
     709if (script_basename() == 'picture.php'
    710710    and !isset($page['image_id']) )
    711711{
Note: See TracChangeset for help on using the changeset viewer.