Moodle

description meta tag is not run through the multi-lang filter even if filterall is set

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.8.8, 1.9.4
  • Fix Version/s: 1.8.9, 1.9.5
  • Component/s: Filters
  • Labels:
    None
  • Difficulty:
    Easy
  • Affected Branches:
    MOODLE_18_STABLE, MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_18_STABLE, MOODLE_19_STABLE

Description

in file moodle/index.php lines 113-115 or so are

print_header($SITE->fullname, $SITE->fullname, 'home', '',
'<meta name="description" content="'. s(strip_tags($SITE->summary)) .'" />',
true, '', user_login_string($SITE).$langmenu);

This creates the meta tag "description" by stripping tags from the site "summary". However, if the summary contains text for multiple languages, this causes all languages to be simply concatenated (not even a space is added). When filterall is set, the content should be run through multilang filter.

Activity

Hide
Eloy Lafuente (stronk7) added a comment -

Done.

Now the site->summary is processed by format_text() in order to apply the multilang filter if necessary. Any resulting html string is stripped, as they are forbidden within the meta tags.

Also note that filterall (format_string) isn't necessary because the site block already is using format_text and we need to follow the same behaviour here (same page).

Resolving as fixed. Thanks for the report, Robert. Ciao

Show
Eloy Lafuente (stronk7) added a comment - Done. Now the site->summary is processed by format_text() in order to apply the multilang filter if necessary. Any resulting html string is stripped, as they are forbidden within the meta tags. Also note that filterall (format_string) isn't necessary because the site block already is using format_text and we need to follow the same behaviour here (same page). Resolving as fixed. Thanks for the report, Robert. Ciao
Hide
Petr Škoda (skodak) added a comment -

reviewed, thanks

Show
Petr Škoda (skodak) added a comment - reviewed, thanks

Dates

  • Created:
    Updated:
    Resolved: