Commit d0978d46 authored by Ranjit Sahoo's avatar Ranjit Sahoo Committed by Damien McKenna
Browse files

Issue #3355945 by Ranjit1032002, Anwoon, DamienMcKenna: Deprecated function:...

Issue #3355945 by Ranjit1032002, Anwoon, DamienMcKenna: Deprecated function: html_entity_decode(): Passing null to parameter #1 ($string) of type string is deprecated in metatag_preprocess_html().
parent 55a191ed
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
Metatag 8.x-1.x-dev, 2023-xx-xx
-------------------------------
#3364554 by DamienMcKenna: Made v1 fixture data more consistent.
#3355945 by Ranjit1032002, Anwoon, DamienMcKenna: Deprecated function:
  html_entity_decode(): Passing null to parameter #1 ($string) of type string is
  deprecated in metatag_preprocess_html().


Metatag 8.x-1.25, 2023-05-31
+6 −4
Original line number Diff line number Diff line
@@ -462,10 +462,12 @@ function metatag_preprocess_html(&$variables) {
  if (!empty($metatag_attachments['#attached']['html_head'])) {
    foreach ($metatag_attachments['#attached']['html_head'] as $attachment) {
      if (!empty($attachment[1]) && $attachment[1] == 'title') {
        // Empty head_title to avoid the site name and slogan to be appended to
        // the meta title.
        if (!empty($attachment[0]['#attributes']['content'])) {
          // Empty head_title to avoid the site name and slogan being appended
          // to the meta title.
          $variables['head_title'] = [];
          $variables['head_title']['title'] = html_entity_decode($attachment[0]['#attributes']['content'], ENT_QUOTES);
        }

        // No need to do anything else after this.
        break;