-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
1.9.5
-
None
-
MOODLE_19_STABLE
-
Easy
While taking a look to MDL-19231 I've detected that ALL the regexp used to detect videos/audios.... whatever, are in the form:
$search = '/<a.?href="([^<])youtube.com\/watch?v=([^"])"[^>]>(.*?)<\/a>/is';
And that .*, no matter of the ? (greedy) after it... seems to be capturing way too much. So any text containing any <a> tag, followed by one URL being processed by the mediaplugin filter.... is really borked (unless I'm forgetting something).
In the filter_mediaplugin_enable_youtube customization, I've replaced it to:
$search = '/<a[^>]?href="([^<])youtube.com\/watch?v=([^"])"[^>]>(.*?)<\/a>/is';
And now it seems to work ok. Perhaps the same change:
.* ==> [^>]* should be applied to all regexp in that filter. It's really strange nobody has claimed that before (sure I'm missing something).
For your consideration, ciao