summaryrefslogtreecommitdiffstats
path: root/system/helpers/url_helper.php
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2014-02-26 17:31:02 +0100
committerAndrey Andreev <narf@devilix.net>2014-02-26 17:31:02 +0100
commitea41c8aa1951216b6a9ccc99832d69d2b41c5ead (patch)
tree57b8b39c7325217795e172cafb71e5f7e63fc563 /system/helpers/url_helper.php
parent4247ed1c0fb588f968f18fd80a5f95debefc63f6 (diff)
Don't use error suppression on realpath() + style adjustments
Diffstat (limited to 'system/helpers/url_helper.php')
-rw-r--r--system/helpers/url_helper.php21
1 files changed, 8 insertions, 13 deletions
diff --git a/system/helpers/url_helper.php b/system/helpers/url_helper.php
index 5f11a42ca..dff1a86d2 100644
--- a/system/helpers/url_helper.php
+++ b/system/helpers/url_helper.php
@@ -148,14 +148,9 @@ if ( ! function_exists('anchor'))
{
$title = (string) $title;
- if ( ! is_array($uri))
- {
- $site_url = preg_match('#^(\w+:)?//#i', $uri) ? $uri : site_url($uri);
- }
- else
- {
- $site_url = site_url($uri);
- }
+ $site_url = is_array($uri)
+ ? site_url($uri)
+ : preg_match('#^(\w+:)?//#i', $uri) ? $uri : site_url($uri);
if ($title === '')
{
@@ -481,11 +476,11 @@ if ( ! function_exists('url_title'))
$q_separator = preg_quote($separator, '#');
$trans = array(
- '&.+?;' => '',
- '[^a-z0-9 _-]' => '',
- '\s+' => $separator,
- '('.$q_separator.')+' => $separator
- );
+ '&.+?;' => '',
+ '[^a-z0-9 _-]' => '',
+ '\s+' => $separator,
+ '('.$q_separator.')+' => $separator
+ );
$str = strip_tags($str);
foreach ($trans as $key => $val)