Skip to content

[BUG]: \Phalcon\Forms\Form->bind the whitelist doesn't work for getValue #15070

Closed
@ivan-zolotavin

Description

@ivan-zolotavin

Steps to reproduce the behavior:

$form = new \Phalcon\Forms\Form();
$form->add(new \Phalcon\Forms\Element\Text('nameFirst'));
$form->add(new \Phalcon\Forms\Element\Text('nameLast'));        
        
$data = [
    'test1' => 'test1',
    'nameFirst' => 'nameFirst',            
    'nameLast' => 'nameLast',
];

$entity = new \stdClass();
$white_list = ['nameFirst', 'nameLast'];
$form->bind($data, $entity, $white_list);        

// return TRUE - valid
var_dump($form->getValue('nameFirst') == 'nameFirst'); 
// return TRUE - NOT valid (not in whitelist/element list)
var_dump($form->getValue('test1') == 'test1');

Details

  • Phalcon version: 4.0.6
  • PHP Version: 7.4.6

Metadata

Metadata

Assignees

Labels

5.0The issues we want to solve in the 5.0 releasebugA bug reportstatus: lowLowstatus: unverifiedUnverified

Type

No type

Projects

Status

Released

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions