MDL-86544 lib: Adjust checks on local URL params
This commit is contained in:
@@ -1041,8 +1041,10 @@ enum param: string {
|
||||
// Absolute, and matches our wwwroot.
|
||||
} else {
|
||||
// Relative - let's make sure there are no tricks.
|
||||
if (validateUrlSyntax('/' . $param, 's-u-P-a-p-f+q?r?') &&
|
||||
!preg_match('/javascript(?:.*\/{2,})?:/i', rawurldecode($param))) {
|
||||
if (
|
||||
validateUrlSyntax('/' . $param, 's-u-P-a-p-f+q?r?') &&
|
||||
!preg_match('/\bjavascript\b[\s\S]*?(?:\:|\/)/i', rawurldecode($param))
|
||||
) {
|
||||
// Valid relative local URL.
|
||||
} else {
|
||||
$param = '';
|
||||
|
||||
Reference in New Issue
Block a user