includes/dbal.php
changeset 276 acfdccf7a2bf
parent 272 e0ec986c0af3
child 279 8acd77a6c19d
child 286 b2f985e4cef3
equal deleted inserted replaced
275:956263992d48 276:acfdccf7a2bf
   143     {
   143     {
   144       dc_here('dbal: oops, looks like Enano isn\'t set up. Constants ENANO_INSTALLED, MIDGET_INSTALLED, and IN_ENANO_INSTALL are all undefined.');
   144       dc_here('dbal: oops, looks like Enano isn\'t set up. Constants ENANO_INSTALLED, MIDGET_INSTALLED, and IN_ENANO_INSTALL are all undefined.');
   145       // scriptPath isn't set yet - we need to autodetect it to avoid infinite redirects
   145       // scriptPath isn't set yet - we need to autodetect it to avoid infinite redirects
   146       if ( !defined('scriptPath') )
   146       if ( !defined('scriptPath') )
   147       {
   147       {
   148         if ( isset($_SERVER['PATH_INFO']) )
   148         if ( isset($_SERVER['PATH_INFO']) && !preg_match('/index\.php$/', $_SERVER['PATH_INFO']) )
   149         {
   149         {
   150           $_SERVER['REQUEST_URI'] = preg_replace(';' . preg_quote($_SERVER['PATH_INFO']) . '$;', '', $_SERVER['REQUEST_URI']);
   150           $_SERVER['REQUEST_URI'] = preg_replace(';' . preg_quote($_SERVER['PATH_INFO']) . '$;', '', $_SERVER['REQUEST_URI']);
   151         }
   151         }
   152         $sp = dirname($_SERVER['REQUEST_URI']);
   152         $sp = dirname($_SERVER['REQUEST_URI']);
   153         if($sp == '/' || $sp == '\\') $sp = '';
   153         if($sp == '/' || $sp == '\\') $sp = '';