Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-54627

Filter out html from string contents added to search

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1
    • Component/s: Global search
    • Labels:
    • Testing Instructions:
      Hide
      1. Enable multilang filter at system level for content and headings
      2. Add an activity in your frontpage containing multilang tags in both the name and description
        • You can use this sting: <span lang="en" class="multilang">is english ok?</span><span lang="ca" class="multilang">is català ok?</span><span lang="es" class="multilang">is español ok?</span><span lang="fr" class="multilang">is français ok?</span>
      3. Setup search (https://docs.moodle.org/31/en/Global_search) and index your site's contents
      4. Search one of the words that is contained in the activity you previously added (note that the first and last word of each multilang tag may be merged when converting HTML to plain text, so better use words in the middle)
      5. The result in search/index.php title and description should contain all languages contents merged together and you should see the result with no tags in the title nor description
      Show
      Enable multilang filter at system level for content and headings Add an activity in your frontpage containing multilang tags in both the name and description You can use this sting: <span lang="en" class="multilang">is english ok?</span><span lang="ca" class="multilang">is català ok?</span><span lang="es" class="multilang">is español ok?</span><span lang="fr" class="multilang">is français ok?</span> Setup search ( https://docs.moodle.org/31/en/Global_search ) and index your site's contents Search one of the words that is contained in the activity you previously added (note that the first and last word of each multilang tag may be merged when converting HTML to plain text, so better use words in the middle) The result in search/index.php title and description should contain all languages contents merged together and you should see the result with no tags in the title nor description
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-54627_master

      Description

      multilang filter can be enabled also for headings like the course fullname or an activity name, so they can contain HTML. We are not passing these text through content_to_text so the span tags would be indexed and displayed as text, this is not nice.

        Attachments

          Activity

            People

            • Assignee:
              dmonllao David Monllaó
              Reporter:
              dmonllao David Monllaó
              Peer reviewer:
              Frédéric Massart
              Integrator:
              Dan Poltawski
              Tester:
              Jake Dallimore
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                23/May/16