Added password_hash
filter
Defaulting to PASSWORD_DEFAULT, will expand to other options if the need arises.
This commit is contained in:
parent
3861bfc571
commit
50ea072929
1 changed files with 10 additions and 4 deletions
|
@ -134,10 +134,16 @@ class Resource extends Object
|
|||
// Applies any filters
|
||||
if ($filter && isset($this->filter[$method][$variable]))
|
||||
{
|
||||
// @todo Definitely could see the need to expand this out
|
||||
// to allow for more robust filters to be applied
|
||||
// similar to how the validation logic work.
|
||||
$global[$variable] = $this->filter[$method][$variable]($value);
|
||||
$function = $this->filter[$method][$variable];
|
||||
|
||||
if ($function == 'password_hash')
|
||||
{
|
||||
$global[$variable] = password_hash($value, PASSWORD_DEFAULT);
|
||||
}
|
||||
else
|
||||
{
|
||||
$global[$variable] = $function($value);
|
||||
}
|
||||
}
|
||||
|
||||
if ($validate && isset($this->validate[$method][$variable]))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue