Fixed some PHP warnings with API pages
authorDan
Fri, 15 May 2009 14:27:35 -0400
changeset 982 bd349add2697
parent 981 888502d761b4
child 983 36e42d787d1d
Fixed some PHP warnings with API pages
includes/paths.php
--- a/includes/paths.php	Fri May 15 14:16:22 2009 -0400
+++ b/includes/paths.php	Fri May 15 14:27:35 2009 -0400
@@ -210,8 +210,7 @@
       {
         $title = basename($_SERVER['SCRIPT_NAME']);
       }
-      if ( scriptPath != '' )
-        $base_uri = str_replace( scriptPath . '/', '', $_SERVER['SCRIPT_NAME'] );
+      $base_uri = scriptPath == '' ? ltrim($_SERVER['SCRIPT_NAME'], '/') : str_replace( scriptPath . '/', '', $_SERVER['SCRIPT_NAME'] );
       
       $this->page = $this->nslist['API'] . sanitize_page_id($base_uri);
       $this->fullpage = $this->nslist['API'] . sanitize_page_id($base_uri);