Skip to content

Commit

Permalink
fix: check for critical schemes in url validation
Browse files Browse the repository at this point in the history
  • Loading branch information
ikkez committed Feb 13, 2022
1 parent a361ad4 commit f185c66
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion audit.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ class Audit extends Prefab {
* @param $str string
**/
function url($str) {
return is_string(filter_var($str,FILTER_VALIDATE_URL));
return is_string(filter_var($str,FILTER_VALIDATE_URL))
&& !preg_match('/^(javascript|php):\/\/.*$/i', $str);
}

/**
Expand Down

0 comments on commit f185c66

Please sign in to comment.