mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Adding test for Validate::ip().
Fixed Ticket #2298. Fixed issue with I10n class not setting default language git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4689 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
51250a4e5d
commit
9ace567e8e
3 changed files with 7 additions and 2 deletions
|
@ -235,6 +235,10 @@ class EmailComponent extends Object{
|
|||
$this->delivery = 'debug';
|
||||
}
|
||||
$__method = '__'.$this->delivery;
|
||||
|
||||
if(low($this->charset) === 'utf-8') {
|
||||
$this->subject = utf8_decode($this->subject);
|
||||
}
|
||||
return $this->$__method();
|
||||
}
|
||||
/**
|
||||
|
|
|
@ -374,7 +374,7 @@ class L10n extends Object {
|
|||
}
|
||||
|
||||
if($this->default) {
|
||||
$this->languagePath = array(2 => $this->__l10nCatalog[$this->default]['localeFallback']);
|
||||
$this->languagePath[2] = $this->__l10nCatalog[$this->default]['localeFallback'];
|
||||
}
|
||||
$this->found = true;
|
||||
Configure::write('Config.language', $this->lang);
|
||||
|
@ -398,7 +398,7 @@ class L10n extends Object {
|
|||
$this->charset = $this->__l10nCatalog[$langKey]['charset'];
|
||||
|
||||
if($this->default) {
|
||||
$this->languagePath = array(2 => $this->__l10nCatalog[$this->default]['localeFallback']);
|
||||
$this->languagePath[2] = $this->__l10nCatalog[$this->default]['localeFallback'];
|
||||
}
|
||||
$this->found = true;
|
||||
Configure::write('Config.language', $this->lang);
|
||||
|
|
|
@ -1216,6 +1216,7 @@ class ValidationTestCase extends UnitTestCase {
|
|||
function testIp() {
|
||||
$validation = new Validation();
|
||||
$this->assertTrue($validation->ip('0.0.0.0'));
|
||||
$this->assertTrue($validation->ip('192.168.1.156'));
|
||||
$this->assertTrue($validation->ip('255.255.255.255'));
|
||||
$this->assertFalse($validation->ip('127.0.0'));
|
||||
$this->assertFalse($validation->ip('127.0.0.a'));
|
||||
|
|
Loading…
Reference in a new issue