Problem/Motivation
After upgrade to civictheme 1.12.1 the site crashed with the message "The website encountered an unexpected error. Try again later.", in recent log message appear this message: "TypeError: strip_tags(): Argument #1 ($string) must be of type string, Drupal\Core\StringTranslation\TranslatableMarkup given in strip_tags() (line 30 of /dati/neuronet/web/themes/contrib/civictheme/includes/menu.inc)"
Steps to reproduce
update CivicTheme to 1.12.1 open any page
Proposed resolution
revert the code web/themes/contrib/civictheme/includes/menu.inc
1) restore line 11:
use Drupal\Component\Utility\Xss;
2) restore line 30:
// $item['title'] = isset($item['title']) ? strip_tags($item['title']) : '';
$item['title'] = isset($item['title']) ? Xss::filter($item['title']) : '';
the stip_tags cause the error.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork civictheme-3563874
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
uffa14 commentedComment #3
dhruv.mittal commentedComment #5
dhruv.mittal commentedComment #6
richardgaunt commentedhttps://github.com/civictheme/monorepo-drupal/pull/1459
I've created the PR in the monorepo.
I've kept strip_tags when title is a string, but removed any manual filtering if its an array since there is already XSS filtering built into render arrays.
Thanks for your MR.
Comment #7
richardgaunt commentedComment #8
fionamorrison23 commentedComment #9
alan.cole commentedComment #11
richardgaunt commentedComment #12
richardgaunt commented