From 7c654e2dd52ab734cdaa4b506f7a26003360e2da Mon Sep 17 00:00:00 2001 From: Keegan Rankin Date: Fri, 16 Feb 2024 13:03:13 -0800 Subject: [PATCH] Prevent fatal error Occurred on search page, but potentially others too --- web/themes/custom/geofresco/geofresco.theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/themes/custom/geofresco/geofresco.theme b/web/themes/custom/geofresco/geofresco.theme index 06a7f2c..97ec8c5 100644 --- a/web/themes/custom/geofresco/geofresco.theme +++ b/web/themes/custom/geofresco/geofresco.theme @@ -16,7 +16,7 @@ function geofresco_preprocess_page_title(&$variables) { return; } $string = isset($variables['title']['#markup']) ? $variables['title']['#markup'] : FALSE; - if ($string && $pos = strpos($string, "'s blog", -7)) { + if ($string && strlen($string) > 7 && $pos = strpos($string, "'s blog", -7)) { $uid = substr($string, 0, $pos); if (is_numeric($uid) && $account = \Drupal\user\Entity\User::load($uid)) { $variables['title'] = [