Moodle

filtering doesn't work when nothing between <a ...> and </a> tag

Details

  • Type: Sub-task Sub-task
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.8.3, 1.9
  • Fix Version/s: 2.0.3
  • Component/s: Filters
  • Labels:
  • Affected Branches:
    MOODLE_18_STABLE, MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_20_STABLE

Description

hello,

I use an application which generates html (validated). And filtering doesn't work. I find it is because there are in the document (I don't no exactly why) empty links followed by other links. That is for example:
<a href="moodle.org></a>
some words. A lot of words. <a href="moodle.org"> Moodle</a>

No filter works between the two links.

I found the problem : It is in the "filter_save_ignore_tags" function in the lib/filterlib.php.
The regular expression use a "+" . If I put a "*" at the place, the problem was corrected.

$pregexp = '/'.$opentag.'(.+?)'.$closetag.'/is';

became :

$pregexp = '/'.$opentag.'(.*?)'.$closetag.'/is';

I don't know if it the ultime solution because I don't know why a "+" was used.

Activity

Hide
Petr Škoda (skodak) added a comment -

This was fixed in the latest weekly, thanks for the report.

Petr

Show
Petr Škoda (skodak) added a comment - This was fixed in the latest weekly, thanks for the report. Petr

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: