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

Command icon 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

uffa14 created an issue. See original summary.

uffa14’s picture

Issue summary: View changes
dhruv.mittal’s picture

Assigned: Unassigned » dhruv.mittal

dhruv.mittal’s picture

Assigned: dhruv.mittal » Unassigned
Status: Active » Needs review
richardgaunt’s picture

https://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.

richardgaunt’s picture

Version: 1.12.2 » 1.x-dev
Assigned: Unassigned » alan.cole
fionamorrison23’s picture

alan.cole’s picture

Assigned: alan.cole » richardgaunt

  • 0ce1075c committed on 1.x
    [#3563874] Updated check for when menu item titles are render arrays. (#...
richardgaunt’s picture

Status: Needs review » Reviewed & tested by the community
richardgaunt’s picture

Version: 1.x-dev » 1.13.0
Assigned: richardgaunt » Unassigned
Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.