Skip to content

Commit

Permalink
Prevent invalid element name (phalcon#12954)
Browse files Browse the repository at this point in the history
* Prevent invalid element name

Prevent create form element with empty name value like ''

* trim name

* Update element.zep

* Update element.zep
  • Loading branch information
emiliodeg authored and chilimatic committed Jan 15, 2018
1 parent 2f12db1 commit 54586d3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions phalcon/forms/element.zep
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ abstract class Element implements ElementInterface
public function __construct(string name, array attributes = [])
{
let name = trim(name);

if empty name {
throw new \InvalidArgumentException("Form element name is required");
}
let this->_name = name;


let this->_attributes = attributes;
let this->_messages = new Group();
}
Expand Down

0 comments on commit 54586d3

Please sign in to comment.