Skip to content

Commit

Permalink
Fix #11457 414 Request-URI Too Large
Browse files Browse the repository at this point in the history
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
madhuracj authored and nijel committed Jun 15, 2016
1 parent bf73797 commit 75724a3
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions libraries/Scripts.class.php
Expand Up @@ -76,10 +76,17 @@ private function _includeFiles($files)
}
}
}
$static_scripts = sprintf(
"<script type='text/javascript' src='js/get_scripts.js.php?%s'></script>",
implode("&", $params)
);
$static_scripts = '';
// Using chunks of 10 files to avoid too long URLs
$script_chunks = array_chunk($params, 10);
foreach ($script_chunks as $script_chunk) {
$url = 'js/get_scripts.js.php?' . implode('&', $script_chunk);

$static_scripts .= sprintf(
'<script type="text/javascript" src="%s"></script>',
htmlspecialchars($url)
);
}
return $first_dynamic_scripts . $static_scripts . $dynamic_scripts;
}

Expand Down

0 comments on commit 75724a3

Please sign in to comment.