mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Merge branch 'master' into 2.5
This commit is contained in:
commit
b8c94fa5d4
3 changed files with 23 additions and 2 deletions
|
@ -206,13 +206,13 @@ class MemcacheEngine extends CacheEngine {
|
||||||
if ($check) {
|
if ($check) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
foreach ($this->_Memcache->getExtendedStats('slabs') as $slabs) {
|
foreach ($this->_Memcache->getExtendedStats('slabs', 0) as $slabs) {
|
||||||
foreach (array_keys($slabs) as $slabId) {
|
foreach (array_keys($slabs) as $slabId) {
|
||||||
if (!is_numeric($slabId)) {
|
if (!is_numeric($slabId)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($this->_Memcache->getExtendedStats('cachedump', $slabId) as $stats) {
|
foreach ($this->_Memcache->getExtendedStats('cachedump', $slabId, 0) as $stats) {
|
||||||
if (!is_array($stats)) {
|
if (!is_array($stats)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1654,6 +1654,22 @@ class ValidationTest extends CakeTestCase {
|
||||||
$this->assertFalse(Validation::decimal('.54321', null, '/^[-+]?[0-9]+(\\.[0-9]+)?$/s'));
|
$this->assertFalse(Validation::decimal('.54321', null, '/^[-+]?[0-9]+(\\.[0-9]+)?$/s'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test localized floats with decimal.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function testDecimalLocaleSet() {
|
||||||
|
$this->skipIf(DS === '\\', 'The locale is not supported in Windows and affect the others tests.');
|
||||||
|
$restore = setlocale(LC_NUMERIC, 0);
|
||||||
|
$this->skipIf(setlocale(LC_NUMERIC, 'de_DE') === false, "The German locale isn't available.");
|
||||||
|
|
||||||
|
$this->assertTrue(Validation::decimal(1.54));
|
||||||
|
$this->assertTrue(Validation::decimal('1.54'));
|
||||||
|
|
||||||
|
setlocale(LC_NUMERIC, $restore);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* testEmail method
|
* testEmail method
|
||||||
*
|
*
|
||||||
|
|
|
@ -425,6 +425,11 @@ class Validation {
|
||||||
$regex = "/^{$sign}{$dnum}{$exp}$/";
|
$regex = "/^{$sign}{$dnum}{$exp}$/";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Workaround localized floats.
|
||||||
|
if (is_float($check)) {
|
||||||
|
$check = str_replace(',', '.', strval($check));
|
||||||
|
}
|
||||||
return self::_check($check, $regex);
|
return self::_check($check, $regex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue