Limit number of included scripts in get_scripts.js.php
This avoids potential DOS, the limit is same as we use for generating the URLs. Signed-off-by: Michal Čihař <michal@cihar.com>
This commit is contained in:
parent
75724a361b
commit
805225a28c
@ -14,7 +14,8 @@ header('Content-Type: text/javascript; charset=UTF-8');
|
||||
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 3600) . ' GMT');
|
||||
|
||||
if (! empty($_GET['scripts']) && is_array($_GET['scripts'])) {
|
||||
foreach ($_GET['scripts'] as $script) {
|
||||
// Only up to 10 scripts as this is what we generate
|
||||
foreach (array_slice($_GET['scripts'], 0, 10) as $script) {
|
||||
// Sanitise filename
|
||||
$script_name = 'js';
|
||||
$path = explode("/", $script);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user