Closed (fixed)
Project:
Visitors (Web Analytics)
Version:
8.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
10 Mar 2022 at 21:44 UTC
Updated:
19 Aug 2022 at 17:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
imclean commentedThis should probably be injected but there are a few other \Drupal calls so they could all be fixed in the one issue.
Comment #3
imclean commentedComment #7
bluegeek9 commentedComment #8
sah62 commentedThere's actually an issue with this fix: \Drupal::service('title_resolver')->getTitle can return an array, and you can't pass an array to htmlspecialchars_decode().
Comment #9
bluegeek9 commentedGood catch. if the result is an array, the '#markup' index should be used.
Comment #10
sah62 commentedHere's a proposed patch. getTitle can also return null, so I thought it best to test the return value to see if it's a string, or an array, and then return an empty string if it isn't a string or an array.
Comment #12
bluegeek9 commentedI added the is_array check. The is_string check is redundant.
Comment #13
bluegeek9 commentedComment #15
bluegeek9 commented