aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Minz/Url.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Minz/Url.php b/lib/Minz/Url.php
index 40cadb49a..d6af50364 100644
--- a/lib/Minz/Url.php
+++ b/lib/Minz/Url.php
@@ -63,6 +63,7 @@ class Minz_Url {
private static function printUri($url, $encodage) {
$uri = '';
$separator = '?';
+ $anchor = '';
if ($encodage === 'html') {
$and = '&';
@@ -70,6 +71,11 @@ class Minz_Url {
$and = '&';
}
+ if (!empty($url['params']['#'])) {
+ $anchor = '#' . ($encodage === 'html' ? htmlspecialchars($url['params']['#'], ENT_QUOTES, 'UTF-8') : $url['params']['#']);
+ unset($url['params']['#']);
+ }
+
if (isset($url['c'])
&& $url['c'] != Minz_Request::defaultControllerName()) {
$uri .= $separator . 'c=' . $url['c'];
@@ -91,6 +97,12 @@ class Minz_Url {
}
}
+ if (!empty($url['#'])) {
+ $uri .= '#' . ($encodage === 'html' ? htmlspecialchars($url['#'], ENT_QUOTES, 'UTF-8') : $url['#']);
+ }
+
+ $uri .= $anchor;
+
return $uri;
}