MDL-85104 lib: Add additional check to local URLs params.
This commit is contained in:
@@ -1067,8 +1067,9 @@ 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:/i', $param)) {
|
||||
// Looks ok.
|
||||
if (validateUrlSyntax('/' . $param, 's-u-P-a-p-f+q?r?') &&
|
||||
!preg_match('/javascript(?:.*\/{2,})?:/i', rawurldecode($param))) {
|
||||
// Valid relative local URL.
|
||||
} else {
|
||||
$param = '';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user