Assumption that site has "title" tag

Created on 26 February 2014, over 10 years ago
Updated 22 February 2023, over 1 year ago

Problem/Motivation

The setup of $variables['tags'] in template_preprocess_opengraph_filter() loops through the provided og tags ($variables['metatags']['og'][$key]). Later in the function, it sets up $theme_images (near line 425) by using title => $variables['tags']['title'] -- but there's no guarantee that the URL we've pulled in provides that metatag. As an example, I used http://facebook.com which seemingly does not provide the title.

Proposed resolution

The easiest thing is to perhaps suppress the PHP warnings by using @$theme_images = ... instead. Probably a better fix is something like:

title => (isset($variables['tags']['title']) ? $variables['tags']['title'] : '')

Remaining tasks

Identify the best solution. Implement it.

User interface changes

none

API changes

none

πŸ› Bug report
Status

Closed: duplicate

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States chrisfromredfin Portland, Maine

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024