cakephp / datasources

CakePHP Datasources
http://cakephp.org
237 stars 114 forks source link

ArraySource: Find with empty field condition returns all records #117

Open liviakuenzli opened 7 years ago

liviakuenzli commented 7 years ago

Situation: An array-based countries table with no record with country_iso_3_code being empty.

$result = $countryModel->find('list',
    array(
        'conditions' => array('country_iso_3_code' => ''),
    )
);

Expected $result to be empty, but it holds all entries of the table.

The following line is probably the culprint: https://github.com/cakephp/datasources/blob/47c4672cbd8902ef57557d50dd772368863596a8/Model/Datasource/ArraySource.php#L253