Skip to content
Snippets Groups Projects
Commit 186b5722 authored by catch's avatar catch
Browse files

Issue #3445072 by longwave, Anybody: Improve "The libraries to include are...

Issue #3445072 by longwave, Anybody: Improve "The libraries to include are encoded incorrectly" check and message

(cherry picked from commit 803c9429)
parent f3b31f50
No related branches found
No related tags found
4 merge requests!11185Issue #3477324 by andypost, alexpott: Fix usage of str_getcsv() and fgetcsv() for PHP 8.4,!9944Issue #3483353: Consider making the createCopy config action optionally fail...,!8325Update file Sort.php,!8095Expose document root on install
Pipeline #163679 passed
+1
......@@ -162,10 +162,11 @@ public function deliver(Request $request, string $file_name) {
$attached_assets = new AttachedAssets();
$include_libraries = explode(',', UrlHelper::uncompressQueryParameter($request->query->get('include')));
// Check that library names are in the correct format.
$validate = function ($libraries_to_check) {
foreach ($libraries_to_check as $library) {
if (substr_count($library, '/') !== 1) {
throw new BadRequestHttpException('The libraries to include are encoded incorrectly.');
if (substr_count($library, '/') === 0) {
throw new BadRequestHttpException(sprintf('The "%s" library name must include at least one slash.', $library));
}
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment