Skip to content
Snippets Groups Projects

Issue #3238915: Refactor (if feasible) uses of the jQuery ready function to use VanillaJS

Closed Issue #3238915: Refactor (if feasible) uses of the jQuery ready function to use VanillaJS
Closed Harumi Jang requested to merge issue/drupal-3238915:3238915-refactor-if-feasible into 9.3.x
2 files
+ 24
18
Compare changes
  • Side-by-side
  • Inline
Files
2
  • 3ddc2e03
    Issue #3264050 by neclimdul, andypost: Fuzzed tag values to... · 3ddc2e03
    catch authored
    Issue #3264050 by neclimdul, andypost: Fuzzed tag values to EntityAutocompleteController::handleAutocomplete can cause deprecation warning
@@ -79,27 +79,29 @@ public function handleAutocomplete(Request $request, $target_type, $selection_ha
@@ -79,27 +79,29 @@ public function handleAutocomplete(Request $request, $target_type, $selection_ha
$matches = [];
$matches = [];
// Get the typed string from the URL, if it exists.
// Get the typed string from the URL, if it exists.
if ($input = $request->query->get('q')) {
if ($input = $request->query->get('q')) {
$typed_string = Tags::explode($input);
$tag_list = Tags::explode($input);
$typed_string = mb_strtolower(array_pop($typed_string));
if (!empty($tag_list)) {
 
$typed_string = mb_strtolower(array_pop($tag_list));
// Selection settings are passed in as a hashed key of a serialized array
// Selection settings are passed in as a hashed key of a serialized array
// stored in the key/value store.
// stored in the key/value store.
$selection_settings = $this->keyValue->get($selection_settings_key, FALSE);
$selection_settings = $this->keyValue->get($selection_settings_key, FALSE);
if ($selection_settings !== FALSE) {
if ($selection_settings !== FALSE) {
$selection_settings_hash = Crypt::hmacBase64(serialize($selection_settings) . $target_type . $selection_handler, Settings::getHashSalt());
$selection_settings_hash = Crypt::hmacBase64(serialize($selection_settings) . $target_type . $selection_handler, Settings::getHashSalt());
if (!hash_equals($selection_settings_hash, $selection_settings_key)) {
if (!hash_equals($selection_settings_hash, $selection_settings_key)) {
// Disallow access when the selection settings hash does not match the
// Disallow access when the selection settings hash does not match the
// passed-in key.
// passed-in key.
throw new AccessDeniedHttpException('Invalid selection settings key.');
throw new AccessDeniedHttpException('Invalid selection settings key.');
 
}
 
}
 
else {
 
// Disallow access when the selection settings key is not found in the
 
// key/value store.
 
throw new AccessDeniedHttpException();
}
}
}
else {
// Disallow access when the selection settings key is not found in the
// key/value store.
throw new AccessDeniedHttpException();
}
$matches = $this->matcher->getMatches($target_type, $selection_handler, $selection_settings, $typed_string);
$matches = $this->matcher->getMatches($target_type, $selection_handler, $selection_settings, $typed_string);
 
}
}
}
return new JsonResponse($matches);
return new JsonResponse($matches);
Loading