Skip to content
Snippets Groups Projects
Commit 81671bc5 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)
(cherry picked from commit 186b5722)
(cherry picked from commit fb257090)
parent 4ae1e42b
No related branches found
No related tags found
2 merge requests!8376Drupal views: adding more granularity to the ‘use ajax’ functionality,!8300Issue #3443586 View area displays even when parent view has no results.
Pipeline #169493 passed with warnings
+7
......@@ -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