Quantcast
Channel: Editor — DataTables forums
Viewing all articles
Browse latest Browse all 3740

Issue with creating hashed passwords with characters using the Editor

$
0
0

My app creates and stores in the database hashed passwords via:

Editor::inst( $db, 'contacts' )
    ->fields(
           Field::inst( 'credential' )->validator( 'Validate::notEmpty' )
              ->setFormatter( function ( $val, $data, $opts ) { return password_hash( $val , PASSWORD_DEFAULT);} )
              ->getFormatter( function ( $val, $data, $opts ) { return null;})
)
    ->process( $_POST )
    ->json();

This works like a charm for passwords using letters (123) and numbers (123). But apparently if the password contains any characters (@#$%), the password_verify() function returns a FALSE.

Any suggestions as to why this might be?


Viewing all articles
Browse latest Browse all 3740