From 4fb9b23b494e4d694bcf64d7a61ab26c7fa1cbfd Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Wed, 18 Nov 2009 16:40:18 +0000 Subject: pass fragments --- it_html.class | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/it_html.class b/it_html.class index 8f2370f..5935730 100644 --- a/it_html.class +++ b/it_html.class @@ -455,7 +455,7 @@ function u(/* ... */) $schemepart = $hostpart ? ($u['scheme'] ? $u['scheme'] . ":" : "") . "//$hostpart" : ""; - $path = $u['path'] . ($u['query'] ? "?" . $u['query'] : "") . ($u['anchor'] ? "#" . $u['anchor'] : ""); + $path = $u['path'] . ($u['query'] ? "?" . $u['query'] : "") . ($u['fragment'] ? "#" . $u['fragment'] : ""); # hack: encode % if not followed by two hex digits $parts = preg_split('/%([^%]{0,2})/', $path, -1, PREG_SPLIT_DELIM_CAPTURE); @@ -463,7 +463,7 @@ function u(/* ... */) $parts[$i] = (preg_match('/[0-9a-f][0-9a-f]/i', $parts[$i]) ? "%" : "%25") . $parts[$i]; $path = join("", $parts); - $path = preg_replace('|[^-\w.+!*(),:?@&=/~$%]|e', 'urlencode(stripslashes("$0"))', $path); # Single quotes are escaped with slash by preg_replace, remove it for urlencode + $path = preg_replace('|[^-\w.+!*(),:?@&=/~$%#]|e', 'urlencode(stripslashes("$0"))', $path); # Single quotes are escaped with slash by preg_replace, remove it for urlencode $path = preg_replace('|^(\w+:)?//[^/]*$|', '$0/', $path); # Add slash if absolute url without a path, e.g. http://gna.ch $queryparams = it_url::params($params); $separator = strpos($path, "?") === false ? "?" : "&"; -- cgit v1.2.3