From: <par...@us...> - 2010-05-12 15:44:45
|
Update of /cvsroot/phpicalendar/phpicalendar/functions In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv30749/functions Modified Files: date_functions.php Log Message: Stop parsing headers when a timestamp is obtained, and refactor resolve_path() Index: date_functions.php =================================================================== RCS file: /cvsroot/phpicalendar/phpicalendar/functions/date_functions.php,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** date_functions.php 12 May 2010 15:26:49 -0000 1.60 --- date_functions.php 12 May 2010 15:44:36 -0000 1.61 *************** *** 65,68 **** --- 65,69 ---- break; } + if ($result) break; } *************** *** 76,81 **** */ function resolve_path($url, $rel_path) { ! $uri = parse_url($url); $uri['proto'] = (isset($uri['proto']) ? $uri['proto'] : 'http://'); $uri['port'] = (isset($uri['port']) ? (':' . $uri['port']) : ''); --- 77,87 ---- */ function resolve_path($url, $rel_path) { ! if (parse_url($rel_path) !== FALSE) { ! // Path is a URL ! return $rel_path; ! } + // Path is relative to this domain + $uri = parse_url($url); $uri['proto'] = (isset($uri['proto']) ? $uri['proto'] : 'http://'); $uri['port'] = (isset($uri['port']) ? (':' . $uri['port']) : ''); *************** *** 86,101 **** ); ! if (parse_url($rel_path) === false) { ! // Path is relative to this domain ! $rel_path = str_replace('\\', '/', $rel_path); ! ! if ($rel_path{0} == '/') ! return $uri['proto'] . '://' . $auth . $uri['host'] . $uri['port'] . $rel_path; ! ! return $uri['proto'] . '://' . $auth . $uri['host'] . $uri['port'] . $uri['path'] . '/' . $rel_path; } ! // Path is absolute ! return $rel_path; } --- 92,103 ---- ); ! $rel_path = str_replace('\\', '/', $rel_path); ! if ($rel_path{0} == '/') { ! // Absolute path ! return $uri['proto'] . '://' . $auth . $uri['host'] . $uri['port'] . $rel_path; } ! // Relative path ! return $uri['proto'] . '://' . $auth . $uri['host'] . $uri['port'] . @$uri['path'] . '/' . $rel_path; } |