Merge pull request #11043 from owncloud/test-againstNull

Return false in case the passed values are not of type string
This commit is contained in:
Clark Tomlinson 2014-09-12 09:42:42 -04:00
commit cfd8b3f976
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);
}