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

Auto-linking filter messing up course labels

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 2.5.1
    • Fix Version/s: None
    • Component/s: Filters
    • Labels:
      None
    • Affected Branches:
      MOODLE_25_STABLE

      Description

      Recently upgraded from 2.3.2 to 2.5.1 to find that course labels were seemingly displaying as raw HTML. Traced the problem to the urltolink filter, which is taking the source HTML of the label, for instance:

      <hr />

      And inserting an empty link between every single character including the enclosing DIV, making the raw page source look extremely messy:

      <div class="no-overflow"><a href="http://" class="_blanktarget"></a><<a href="http://" class="_blanktarget"></a>d<a href="http://" class="_blanktarget"></a>i<a href="http://" class="_blanktarget"></a>v<a href="http://" class="_blanktarget"></a> <a href="http://" class="_blanktarget"></a>c<a href="http://" class="_blanktarget"></a>l<a href="http://" class="_blanktarget"></a>a<a href="http://" class="_blanktarget"></a>s<a href="http://" class="_blanktarget"></a>s<a href="http://" class="_blanktarget"></a>=<a href="http://" class="_blanktarget"></a>"<a href="http://" class="_blanktarget"></a>n<a href="http://" class="_blanktarget"></a>o<a href="http://" class="_blanktarget"></a>-<a href="http://" class="_blanktarget"></a>o<a href="http://" class="_blanktarget"></a>v<a href="http://" class="_blanktarget"></a>e<a href="http://" class="_blanktarget"></a>r<a href="http://" class="_blanktarget"></a>f<a href="http://" class="_blanktarget"></a>l<a href="http://" class="_blanktarget"></a>o<a href="http://" class="_blanktarget"></a>w<a href="http://" class="_blanktarget"></a>"<a href="http://" class="_blanktarget"></a>><a href="http://" class="_blanktarget"></a><<a href="http://" class="_blanktarget"></a>h<a href="http://" class="_blanktarget"></a>r<a href="http://" class="_blanktarget"></a> <a href="http://" class="_blanktarget"></a>/<a href="http://" class="_blanktarget"></a>><a href="http://" class="_blanktarget"></a><<a href="http://" class="_blanktarget"></a>/<a href="http://" class="_blanktarget"></a>d<a href="http://" class="_blanktarget"></a>i<a href="http://" class="_blanktarget"></a>v<a href="http://" class="_blanktarget"></a>><a href="http://" class="_blanktarget"></a></div>

      To work around this I have to configure "filter_urltolink | formats" to untick everything except "Moodle auto-format". This obviously renders the filter useless for HTML and plain text input.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              jc Johann Campbell
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: