Merge branch '2.3', remote-tracking branch 'origin' into feature/smtp-tls

This commit is contained in:
Jorge González 2012-07-21 20:49:46 +01:00
commit f1250a3609
3 changed files with 10 additions and 2 deletions

View file

@ -125,10 +125,14 @@ class DatabaseSessionTest extends CakeTestCase {
'Session' => array(
'id' => 'foo',
'data' => 'Some value',
'expires' => time() + (Configure::read('Session.timeout') * 60)
)
);
$expires = $result['Session']['expires'];
unset($result['Session']['expires']);
$this->assertEquals($expected, $result);
$expected = time() + (Configure::read('Session.timeout') * 60);
$this->assertWithinMargin($expires, $expected, 1);
}
/**

View file

@ -1782,6 +1782,10 @@ class ValidationTest extends CakeTestCase {
$this->assertFalse(Validation::url('www.cakephp.org', true));
$this->assertTrue(Validation::url('http://www.cakephp.org', true));
$this->assertTrue(Validation::url('http://example.com/~userdir/'));
$this->assertTrue(Validation::url('http://underscore_subdomain.example.org'));
$this->assertTrue(Validation::url('http://_jabber._tcp.gmail.com'));
$this->assertFalse(Validation::url('http://www.underscore_domain.org'));
$this->assertFalse(Validation::url('http://_jabber._tcp.g_mail.com'));
$this->assertTrue(Validation::url('http://example.com/~userdir/subdir/index.html'));
$this->assertTrue(Validation::url('http://www.zwischenraume.de'));

View file

@ -38,7 +38,7 @@ class Validation {
* @var array
*/
protected static $_pattern = array(
'hostname' => '(?:[a-z0-9][-a-z0-9]*\.)*(?:[a-z0-9][-a-z0-9]{0,62})\.(?:(?:[a-z]{2}\.)?[a-z]{2,4}|museum|travel)'
'hostname' => '(?:[-_a-z0-9][-_a-z0-9]*\.)*(?:[a-z0-9][-a-z0-9]{0,62})\.(?:(?:[a-z]{2}\.)?[a-z]{2,4}|museum|travel)'
);
/**