(.*?)<\/div>/s", "$1", $rendered);
- if (empty(trim($rendered))) {
+ if (is_null($rendered)) {
unset($pattern[$region]);
+ } else {
+ // Remove all wrapper divs so we can check if the region actually has any
+ // visible output.
+ $rendered = preg_replace("/
(.*?)<\/div>/s", "$1", $rendered);
+ $rendered = preg_replace("/(.*?)<\/div>/s", "$1", $rendered);
+ if (empty(trim($rendered))) {
+ unset($pattern[$region]);
+ }
}
continue;
diff --git a/docroot/modules/humsci/hs_layouts/hs_layouts.module b/docroot/modules/humsci/hs_layouts/hs_layouts.module
index a1debe0faa..110c2edb9b 100644
--- a/docroot/modules/humsci/hs_layouts/hs_layouts.module
+++ b/docroot/modules/humsci/hs_layouts/hs_layouts.module
@@ -209,7 +209,7 @@ function hs_layouts_preprocess_pattern_vertical_card(&$variables) {
$renderer = \Drupal::service('renderer');
$title_rendered = is_array($variables['title']) ? $renderer->renderInIsolation($variables['title']) : $variables['title'];
- if (strpos($title_rendered ?? '', '
Date: Thu, 9 Jan 2025 17:51:31 -0800
Subject: [PATCH 4/4] Added a patch for the Shield module to prevent Watchdog
warning messages.
---
composer.json | 3 +++
...-undefined_array_key_explode-3479117.patch | 27 +++++++++++++++++++
2 files changed, 30 insertions(+)
create mode 100644 patches/shield-undefined_array_key_explode-3479117.patch
diff --git a/composer.json b/composer.json
index 2360b97c15..36d60c781b 100644
--- a/composer.json
+++ b/composer.json
@@ -283,6 +283,9 @@
"https://www.drupal.org/project/redirect/issues/3057250": "https://www.drupal.org/files/issues/2024-08-11/redirect--2024-08-11--3057250-79.patch",
"https://www.drupal.org/project/redirect/issues/3018897": "https://www.drupal.org/files/issues/2024-08-12/redirect-3018897-28.patch"
},
+ "drupal/shield": {
+ "https://www.drupal.org/project/shield/issues/3479117": "patches/shield-undefined_array_key_explode-3479117.patch"
+ },
"drupal/ui_patterns": {
"Ui Patterns Views Preview": "patches/contrib/ui_patterns_views-preview.patch"
},
diff --git a/patches/shield-undefined_array_key_explode-3479117.patch b/patches/shield-undefined_array_key_explode-3479117.patch
new file mode 100644
index 0000000000..595ec2fe5f
--- /dev/null
+++ b/patches/shield-undefined_array_key_explode-3479117.patch
@@ -0,0 +1,27 @@
+diff --git a/src/ShieldMiddleware.php b/src/ShieldMiddleware.php
+index f2a0b56..eb9d993 100644
+--- a/src/ShieldMiddleware.php
++++ b/src/ShieldMiddleware.php
+@@ -209,10 +209,20 @@ class ShieldMiddleware implements HttpKernelInterface {
+ $input_pass = $request->server->get('PHP_AUTH_PW');
+ }
+ elseif (!empty($request->server->get('HTTP_AUTHORIZATION'))) {
+- [$input_user, $input_pass] = explode(':', base64_decode(substr($request->server->get('HTTP_AUTHORIZATION'), 6)), 2);
++ $decoded = base64_decode(substr($request->server->get('HTTP_AUTHORIZATION'), 6));
++ $credentials = explode(':', $decoded, 2);
++
++ if (count($credentials) === 2) {
++ [$input_user, $input_pass] = $credentials;
++ }
+ }
+ elseif (!empty($request->server->get('REDIRECT_HTTP_AUTHORIZATION'))) {
+- [$input_user, $input_pass] = explode(':', base64_decode(substr($request->server->get('REDIRECT_HTTP_AUTHORIZATION'), 6)), 2);
++ $decoded = base64_decode(substr($request->server->get('REDIRECT_HTTP_AUTHORIZATION'), 6));
++ $credentials = explode(':', $decoded, 2);
++
++ if (count($credentials) === 2) {
++ [$input_user, $input_pass] = $credentials;
++ }
+ }
+ if (isset($input_user) && $input_user === $user && hash_equals($pass, $input_pass)) {
+ $request->headers->set('X-Shield-Status', 'authenticated');