mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-02 17:42:41 +00:00
Merge branch 'master' into 2.4
Conflicts: lib/Cake/Network/CakeResponse.php lib/Cake/TestSuite/CakeTestCase.php
This commit is contained in:
commit
0f2d59d987
41 changed files with 133 additions and 83 deletions
|
@ -149,7 +149,7 @@ class Validation {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!is_null($regex)) {
|
||||
if ($regex !== null) {
|
||||
if (self::_check($check, $regex)) {
|
||||
return self::luhn($check, $deep);
|
||||
}
|
||||
|
@ -297,7 +297,7 @@ class Validation {
|
|||
* @return boolean Success
|
||||
*/
|
||||
public static function date($check, $format = 'ymd', $regex = null) {
|
||||
if (!is_null($regex)) {
|
||||
if ($regex !== null) {
|
||||
return self::_check($check, $regex);
|
||||
}
|
||||
|
||||
|
@ -390,7 +390,7 @@ class Validation {
|
|||
* @return boolean Success
|
||||
*/
|
||||
public static function decimal($check, $places = null, $regex = null) {
|
||||
if (is_null($regex)) {
|
||||
if ($regex === null) {
|
||||
$lnum = '[0-9]+';
|
||||
$dnum = "[0-9]*[\.]{$lnum}";
|
||||
$sign = '[+-]?';
|
||||
|
@ -430,7 +430,7 @@ class Validation {
|
|||
extract(self::_defaults($check));
|
||||
}
|
||||
|
||||
if (is_null($regex)) {
|
||||
if ($regex === null) {
|
||||
$regex = '/^[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&\'*+\/=?^_`{|}~-]+)*@' . self::$_pattern['hostname'] . '$/i';
|
||||
}
|
||||
$return = self::_check($check, $regex);
|
||||
|
@ -612,7 +612,7 @@ class Validation {
|
|||
extract(self::_defaults($check));
|
||||
}
|
||||
|
||||
if (is_null($regex)) {
|
||||
if ($regex === null) {
|
||||
switch ($country) {
|
||||
case 'us':
|
||||
case 'ca':
|
||||
|
@ -649,7 +649,7 @@ class Validation {
|
|||
extract(self::_defaults($check));
|
||||
}
|
||||
|
||||
if (is_null($regex)) {
|
||||
if ($regex === null) {
|
||||
switch ($country) {
|
||||
case 'uk':
|
||||
$regex = '/\\A\\b[A-Z]{1,2}[0-9][A-Z0-9]? [0-9][ABD-HJLNP-UW-Z]{2}\\b\\z/i';
|
||||
|
@ -710,7 +710,7 @@ class Validation {
|
|||
extract(self::_defaults($check));
|
||||
}
|
||||
|
||||
if (is_null($regex)) {
|
||||
if ($regex === null) {
|
||||
switch ($country) {
|
||||
case 'dk':
|
||||
$regex = '/\\A\\b[0-9]{6}-[0-9]{4}\\b\\z/i';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue