Ignore:
Timestamp:
Jan 24, 2007, 6:07:08 AM (17 years ago)
Author:
rvelices
Message:
  • plugins with own independent scripts work now (cookie_path and url root are

correct)

  • prepare a bit some url functions so that later we can fully embed pwg in

scripts located outside pwg

  • remove some unnecessary language strings
File:
1 edited

Legend:

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

    r1623 r1750  
    112112  }
    113113  $scr = substr($scr,0,strrpos( $scr,'/'));
     114
    114115  // add a trailing '/' if needed
    115   return ($scr{strlen($scr)-1} == '/') ? $scr : $scr . '/';
     116  $scr .= ($scr{strlen($scr)-1} == '/') ? '' : '/';
     117 
     118  if ( substr(PHPWG_ROOT_PATH,0,3)=='../')
     119  { // this is maybe a plugin inside pwg directory
     120    // TODO - what if it is an external script outside PWG ?
     121    $scr = $scr.PHPWG_ROOT_PATH;
     122    while (1)
     123    {
     124      $new = preg_replace('#[^/]+/\.\.(/|$)#', '', $scr);
     125      if ($new==$scr)
     126      {
     127        break;
     128      }
     129      $scr=$new;
     130    }
     131  }
     132  return $scr;
    116133}
    117134
Note: See TracChangeset for help on using the changeset viewer.