Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Duplicate
-
Affects Version/s: 1.9.5
-
Fix Version/s: None
-
Component/s: Filters
-
Labels:None
-
Difficulty:Easy
-
Affected Branches:MOODLE_19_STABLE
Description
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 ![]()
Issue Links
Activity
- All
- Comments
- History
- Activity
- Source
- Test Sessions