summaryrefslogtreecommitdiffstats
path: root/system/helpers
diff options
context:
space:
mode:
authorDerek Jones <derek.jones@ellislab.com>2007-07-11 23:59:12 +0200
committerDerek Jones <derek.jones@ellislab.com>2007-07-11 23:59:12 +0200
commit1f2fd2d5db0ff9e91388cec079a9ff58392ab654 (patch)
treed64ffe5491f0c1314938e72b9c52e73f8755a892 /system/helpers
parent9687c493de92eb71a91ed89723abd4ede977bb3d (diff)
adding type casting of $title argument in URL helper functions to a string. A numeric 0 sent to these functions would evaluate if ($title == '') as TRUE, and type casting seems the more appropriate fix than simply using $title === '', since we're expecting and treating $title as a string.
Diffstat (limited to 'system/helpers')
-rw-r--r--system/helpers/url_helper.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php
index c05bc2088..01cd3458d 100644
--- a/system/helpers/url_helper.php
+++ b/system/helpers/url_helper.php
@@ -90,6 +90,8 @@ function index_page()
*/
function anchor($uri = '', $title = '', $attributes = '')
{
+ $title = (string) $title;
+
if ( ! is_array($uri))
{
$site_url = ( ! preg_match('!^\w+://!i', $uri)) ? site_url($uri) : $uri;
@@ -132,6 +134,8 @@ function anchor($uri = '', $title = '', $attributes = '')
*/
function anchor_popup($uri = '', $title = '', $attributes = FALSE)
{
+ $title = (string) $title;
+
$site_url = ( ! preg_match('!^\w+://!i', $uri)) ? site_url($uri) : $uri;
if ($title == '')
@@ -170,6 +174,8 @@ function anchor_popup($uri = '', $title = '', $attributes = FALSE)
*/
function mailto($email, $title = '', $attributes = '')
{
+ $title = (string) $title;
+
if ($title == "")
{
$title = $email;
@@ -195,6 +201,8 @@ function mailto($email, $title = '', $attributes = '')
*/
function safe_mailto($email, $title = '', $attributes = '')
{
+ $title = (string) $title;
+
if ($title == "")
{
$title = $email;