mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
adding sms as protocol
This commit is contained in:
parent
2a674fc461
commit
b6fe8af701
3 changed files with 16 additions and 1 deletions
|
@ -833,7 +833,8 @@ class Router {
|
||||||
(strpos($url, '://') !== false ||
|
(strpos($url, '://') !== false ||
|
||||||
(strpos($url, 'javascript:') === 0) ||
|
(strpos($url, 'javascript:') === 0) ||
|
||||||
(strpos($url, 'mailto:') === 0) ||
|
(strpos($url, 'mailto:') === 0) ||
|
||||||
(strpos($url, 'tel:') === 0)) ||
|
(strpos($url, 'tel:') === 0) ||
|
||||||
|
(strpos($url, 'sms:') === 0)) ||
|
||||||
(!strncmp($url, '#', 1))
|
(!strncmp($url, '#', 1))
|
||||||
) {
|
) {
|
||||||
return $url;
|
return $url;
|
||||||
|
|
|
@ -2485,8 +2485,14 @@ class RouterTest extends CakeTestCase {
|
||||||
$url = '://example.com';
|
$url = '://example.com';
|
||||||
$this->assertEquals($url, Router::url($url));
|
$this->assertEquals($url, Router::url($url));
|
||||||
|
|
||||||
|
$url = 'javascript:void(0)';
|
||||||
|
$this->assertEquals($url, Router::url($url));
|
||||||
|
|
||||||
$url = 'tel:012345-678';
|
$url = 'tel:012345-678';
|
||||||
$this->assertEquals($url, Router::url($url));
|
$this->assertEquals($url, Router::url($url));
|
||||||
|
|
||||||
|
$url = 'sms:012345-678';
|
||||||
|
$this->assertEquals($url, Router::url($url));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -349,6 +349,14 @@ class HtmlHelperTest extends CakeTestCase {
|
||||||
$result = $this->Html->link('call me on 0123465-798', 'tel:0123465-798');
|
$result = $this->Html->link('call me on 0123465-798', 'tel:0123465-798');
|
||||||
$expected = array('a' => array('href' => 'tel:0123465-798'), 'call me on 0123465-798', '/a');
|
$expected = array('a' => array('href' => 'tel:0123465-798'), 'call me on 0123465-798', '/a');
|
||||||
$this->assertTags($result, $expected);
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
|
$result = $this->Html->link('text me on 0123465-798', 'sms:0123465-798');
|
||||||
|
$expected = array('a' => array('href' => 'sms:0123465-798'), 'text me on 0123465-798', '/a');
|
||||||
|
$this->assertTags($result, $expected);
|
||||||
|
|
||||||
|
$result = $this->Html->link('say hello to 0123465-798', 'sms:0123465-798?body=hello there');
|
||||||
|
$expected = array('a' => array('href' => 'sms:0123465-798?body=hello there'), 'say hello to 0123465-798', '/a');
|
||||||
|
$this->assertTags($result, $expected);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue