diff options
author | Andy Staudacher <andy.st@gmail.com> | 2009-06-06 15:24:49 -0700 |
---|---|---|
committer | Andy Staudacher <andy.st@gmail.com> | 2009-06-06 15:24:49 -0700 |
commit | b9ee6f7d185c734dcff595d06d9c6e6fda5822ac (patch) | |
tree | 4cc37bde852469449afd0989bfceeeddac84a200 /system/helpers | |
parent | 0e415dae9b29d792f631d3b94349086b8094c920 (diff) | |
parent | b179b106c2b4d3971498f513ffc71eff1b6b1a5d (diff) |
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'system/helpers')
-rw-r--r-- | system/helpers/html.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/system/helpers/html.php b/system/helpers/html.php index 9ad20d89..2c609567 100644 --- a/system/helpers/html.php +++ b/system/helpers/html.php @@ -2,7 +2,7 @@ /** * HTML helper class. * - * $Id: html.php 4368 2009-05-27 21:58:51Z samsoir $ + * $Id: html.php 4376 2009-06-01 11:40:39Z samsoir $ * * @package Core * @author Kohana Team @@ -68,15 +68,21 @@ class html_Core { * @param string link text * @param array HTML anchor attributes * @param string non-default protocol, eg: https + * @param boolean option to escape the title that is output * @return string */ - public static function anchor($uri, $title = NULL, $attributes = NULL, $protocol = NULL) + public static function anchor($uri, $title = NULL, $attributes = NULL, $protocol = NULL, $escape_title = FALSE) { if ($uri === '') { $site_url = url::base(FALSE); } - elseif (strpos($uri, '://') === FALSE AND strpos($uri, '#') !== 0) + elseif (strpos($uri, '#') === 0) + { + // This is an id target link, not a URL + $site_url = $uri; + } + elseif (strpos($uri, '://') === FALSE) { $site_url = url::site($uri, $protocol); } @@ -96,7 +102,7 @@ class html_Core { // Attributes empty? Use an empty string .(is_array($attributes) ? html::attributes($attributes) : '').'>' // Title empty? Use the parsed URL - .html::specialchars((($title === NULL) ? $site_url : $title), FALSE).'</a>'; + .($escape_title ? html::specialchars((($title === NULL) ? $site_url : $title), FALSE) : (($title === NULL) ? $site_url : $title)).'</a>'; } /** |