Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

multiple strpos to preg_match

  • Loading branch information...
commit 57bf15a415adc6d498bc0f9faac33b1ebf1a4672 1 parent 319658e
@dereuromark dereuromark authored
Showing with 1 addition and 8 deletions.
  1. +1 −8 lib/Cake/Routing/Router.php
View
9 lib/Cake/Routing/Router.php
@@ -829,14 +829,7 @@ public static function url($url = null, $full = false) {
$output = self::_handleNoRoute($url);
}
} else {
- if (
- (strpos($url, '://') !== false ||
- (strpos($url, 'javascript:') === 0) ||
- (strpos($url, 'mailto:') === 0) ||
- (strpos($url, 'tel:') === 0) ||
- (strpos($url, 'sms:') === 0)) ||
- (!strncmp($url, '#', 1))
- ) {
+ if (preg_match('/:\/\/|^(javascript|mailto|tel|sms):|\#/i', $url)) {
return $url;
}
if (substr($url, 0, 1) === '/') {
Please sign in to comment.
Something went wrong with that request. Please try again.