Prevent fatal error
Occurred on search page, but potentially others too
This commit is contained in:
parent
e18bfc02d0
commit
7c654e2dd5
1 changed files with 1 additions and 1 deletions
|
@ -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'] = [
|
||||
|
|
Loading…
Add table
Reference in a new issue