Skip to content

Commit

Permalink
multiple strpos to preg_match
Browse files Browse the repository at this point in the history
  • Loading branch information
euromark committed Aug 1, 2012
1 parent 319658e commit 57bf15a
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions lib/Cake/Routing/Router.php
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -829,14 +829,7 @@ public static function url($url = null, $full = false) {
$output = self::_handleNoRoute($url); $output = self::_handleNoRoute($url);
} }
} else { } else {
if ( if (preg_match('/:\/\/|^(javascript|mailto|tel|sms):|\#/i', $url)) {
(strpos($url, '://') !== false ||
(strpos($url, 'javascript:') === 0) ||
(strpos($url, 'mailto:') === 0) ||
(strpos($url, 'tel:') === 0) ||
(strpos($url, 'sms:') === 0)) ||
(!strncmp($url, '#', 1))
) {
return $url; return $url;
} }
if (substr($url, 0, 1) === '/') { if (substr($url, 0, 1) === '/') {
Expand Down

0 comments on commit 57bf15a

Please sign in to comment.