Return false in case one of the values is null

This commit is contained in:
Lukas Reschke 2014-09-12 13:32:59 +02:00
parent 7afca08255
commit 5ff999d69d
1 changed files with 4 additions and 0 deletions

View File

@ -25,6 +25,10 @@ class StringUtils {
*/
public static function equals($expected, $input) {
if(!is_string($expected) || !is_string($input)) {
return false;
}
if(function_exists('hash_equals')) {
return hash_equals($expected, $input);
}