includes/dbal.php
changeset 231 9a1a32bc2050
parent 229 b2f985e4cef3
child 232 2b60c89dc27f
equal deleted inserted replaced
230:f6d144cba8a9 231:9a1a32bc2050
   145       if ( !defined('scriptPath') )
   145       if ( !defined('scriptPath') )
   146       {
   146       {
   147         if ( isset($_SERVER['PATH_INFO']) && !preg_match('/index\.php$/', $_SERVER['PATH_INFO']) )
   147         if ( isset($_SERVER['PATH_INFO']) && !preg_match('/index\.php$/', $_SERVER['PATH_INFO']) )
   148         {
   148         {
   149           $_SERVER['REQUEST_URI'] = preg_replace(';' . preg_quote($_SERVER['PATH_INFO']) . '$;', '', $_SERVER['REQUEST_URI']);
   149           $_SERVER['REQUEST_URI'] = preg_replace(';' . preg_quote($_SERVER['PATH_INFO']) . '$;', '', $_SERVER['REQUEST_URI']);
       
   150         }
       
   151         if ( !preg_match('/\.php$/', $_SERVER['REQUEST_URI']) )
       
   152         {
       
   153           // user requested http://foo/enano as opposed to http://foo/enano/index.php
       
   154           $_SERVER['REQUEST_URI'] .= '/index.php';
   150         }
   155         }
   151         $sp = dirname($_SERVER['REQUEST_URI']);
   156         $sp = dirname($_SERVER['REQUEST_URI']);
   152         if($sp == '/' || $sp == '\\') $sp = '';
   157         if($sp == '/' || $sp == '\\') $sp = '';
   153         define('scriptPath', $sp);
   158         define('scriptPath', $sp);
   154         define('contentPath', "$sp/index.php?title=");
   159         define('contentPath', "$sp/index.php?title=");