Skip to content

Commit

Permalink
Merge pull request owncloud#11043 from owncloud/test-againstNull
Browse files Browse the repository at this point in the history
Return false in case the passed values are not of type string
  • Loading branch information
th3fallen committed Sep 12, 2014
2 parents d6834b6 + 5ff999d commit cfd8b3f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/private/security/stringutils.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit cfd8b3f

Please sign in to comment.