Browse files

allowing tel protocol for mobile devices

  • Loading branch information...
1 parent d94cdc6 commit b73be3139f3394d73f7a2c459b3f6c061b30ef6b @dereuromark dereuromark committed Aug 1, 2012
Showing with 5 additions and 1 deletion.
  1. +2 −1 lib/Cake/Routing/Router.php
  2. +3 −0 lib/Cake/Test/Case/Routing/RouterTest.php
View
3 lib/Cake/Routing/Router.php
@@ -832,7 +832,8 @@ public static function url($url = null, $full = false) {
if (
(strpos($url, '://') !== false ||
(strpos($url, 'javascript:') === 0) ||
- (strpos($url, 'mailto:') === 0)) ||
+ (strpos($url, 'mailto:') === 0) ||
+ (strpos($url, 'tel:') === 0)) ||
(!strncmp($url, '#', 1))
) {
return $url;
View
3 lib/Cake/Test/Case/Routing/RouterTest.php
@@ -2484,6 +2484,9 @@ public function testUrlProtocol() {
$url = '://example.com';
$this->assertEquals($url, Router::url($url));
+
+ $url = 'tel:012345-678';
+ $this->assertEquals($url, Router::url($url));
}
/**

0 comments on commit b73be31

Please sign in to comment.