mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-06 19:42:41 +00:00
Merge branch 'master' into 2.4
Conflicts: lib/Cake/Console/Command/ConsoleShell.php
This commit is contained in:
commit
38b050a711
52 changed files with 407 additions and 122 deletions
|
@ -1637,9 +1637,10 @@ class Model extends Object implements CakeEventListener {
|
|||
}
|
||||
|
||||
if (!empty($options['fieldList'])) {
|
||||
$this->whitelist = $options['fieldList'];
|
||||
if (!empty($options['fieldList'][$this->alias]) && is_array($options['fieldList'][$this->alias])) {
|
||||
$this->whitelist = $options['fieldList'][$this->alias];
|
||||
} elseif (Hash::dimensions($options['fieldList']) < 2) {
|
||||
$this->whitelist = $options['fieldList'];
|
||||
}
|
||||
} elseif ($options['fieldList'] === null) {
|
||||
$this->whitelist = array();
|
||||
|
@ -2360,7 +2361,10 @@ class Model extends Object implements CakeEventListener {
|
|||
$options['fieldList'][$this->alias][] = $key;
|
||||
return $options;
|
||||
}
|
||||
if (!empty($options['fieldList']) && is_array($options['fieldList'])) {
|
||||
if (!empty($options['fieldList']) &&
|
||||
is_array($options['fieldList']) &&
|
||||
Hash::dimensions($options['fieldList']) < 2
|
||||
) {
|
||||
$options['fieldList'][] = $key;
|
||||
}
|
||||
return $options;
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
*/
|
||||
|
||||
App::uses('CakeValidationSet', 'Model/Validator');
|
||||
App::uses('Hash', 'Utility');
|
||||
|
||||
/**
|
||||
* ModelValidator object encapsulates all methods related to data validations for a model
|
||||
|
@ -394,11 +395,11 @@ class ModelValidator implements ArrayAccess, IteratorAggregate, Countable {
|
|||
}
|
||||
unset($fieldList);
|
||||
|
||||
$validateList = array();
|
||||
if (empty($whitelist)) {
|
||||
if (empty($whitelist) || Hash::dimensions($whitelist) > 1) {
|
||||
return $this->_fields;
|
||||
}
|
||||
|
||||
$validateList = array();
|
||||
$this->validationErrors = array();
|
||||
foreach ((array)$whitelist as $f) {
|
||||
if (!empty($this->_fields[$f])) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue