[phpwebapp-commits] CVS: web_app class.WebApp.php,1.26,1.27
Brought to you by:
dashohoxha
From: Dashamir H. <das...@us...> - 2005-07-06 15:28:34
|
Update of /cvsroot/phpwebapp/web_app In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3598 Modified Files: class.WebApp.php Log Message: Index: class.WebApp.php =================================================================== RCS file: /cvsroot/phpwebapp/web_app/class.WebApp.php,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** class.WebApp.php 30 Jun 2005 06:24:43 -0000 1.26 --- class.WebApp.php 6 Jul 2005 15:28:24 -0000 1.27 *************** *** 583,588 **** function to_url($path) { ! $DocumentRoot = ereg_replace(APP_URL.'$', '', APP_PATH); ! $url = str_replace($DocumentRoot, '', $path); return $url; } --- 583,603 ---- function to_url($path) { ! if ($path[0]!='/') ! { ! //$path is a relative path ! $url = APP_URL.$path; ! } ! else ! { ! //$path is an absolute path ! $app_url = APP_URL; ! ereg('^(/~[^/]+)/', $app_url, $regs); ! $user_dir = $regs[1]; ! $app_url = ereg_replace("^$user_dir", '', $app_url); ! $DocumentRoot = ereg_replace($app_url.'$', '', APP_PATH); ! $url = str_replace($DocumentRoot, '', $path); ! $url = $user_dir.$url; ! } ! return $url; } |