Skip to content

Commit 78796ac

Browse files
committed
PHPStan fixes.
1 parent 08d8f19 commit 78796ac

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

web/themes/contrib/civictheme/civictheme.theme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,5 +277,5 @@ function civictheme_page_attachments_alter(array &$attachments) {
277277
catch (ComponentNotFoundException $exception) {
278278
\Drupal::logger('civictheme')->error('Unable to find alert component: %message', ['%message' => $exception->getMessage()]);
279279
}
280-
$attachments['#cache']['contexts'] = Cache::mergeContexts($variables['#cache']['contexts'] ?? [], ['url.query_args']);
280+
$attachments['#cache']['contexts'] = Cache::mergeContexts($attachments['#cache']['contexts'] ?? [], ['url.query_args']);
281281
}

web/themes/contrib/civictheme/includes/search.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@ function _civictheme_preprocess_html__search_head_title(array &$variables): void
6161
if (empty($keywords)) {
6262
return;
6363
}
64-
$head_title = (string) $variables['head_title']['title'] ?? '';
64+
$head_title = (string) ($variables['head_title']['title'] ?? '');
6565
if (empty($head_title)) {
6666
return;
6767
}
68-
$sanitized_keywords = htmlspecialchars($keywords, ENT_QUOTES, 'UTF-8');
68+
$sanitized_keywords = htmlspecialchars((string) $keywords, ENT_QUOTES, 'UTF-8');
6969
$variables['head_title']['title'] = t("@title - Searching for '@keywords'", [
7070
'@title' => $head_title,
7171
'@keywords' => $sanitized_keywords,

0 commit comments

Comments
 (0)