Error trying to use an embed code with line breaks
Bug #1421444 reported by
Aaron Wells
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mahara |
Fix Released
|
Medium
|
Aaron Wells |
Bug Description
I noticed this while testing out a Kaltura embed code that was mentioned on the mahara.org forums: https:/
I noticed that the embed code provided by the user worked in Mahara 1.9 & 1.10, but not in 15.04dev. When I tried to enter this embed code in 15.04dev, I received a form validation error: "Invalid URL or embed code".
After running git bisect, I discovered that it was a problem in the validation regex we added for Bug 1381807. Specifically, the regex errors out when trying to validate an embed code that contains line breaks. If I delete the line breaks and make the embed code all one line, it works.
Changed in mahara: | |
importance: | High → Medium |
Changed in mahara: | |
status: | In Progress → Fix Committed |
Changed in mahara: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
To test:
1. Put an "External media" block in a Page
2. Enter an embed code into the block, and verify that it works. For instance, this one from YouTube:
<iframe width="420" height="315" src="https:/ /www.youtube. com/embed/ sVMhuiHm50I" frameborder="0" allowfullscreen ></iframe>
3. Save the block and verify that the embed code works.
4. Edit the external media block, and insert a line break into the embed code. Like this:
<iframe width="420" height="315" src="https:/ /www.youtube. com/embed/ sVMhuiHm50I" frameborder="0" allowfullscreen ></iframe>
Expected result: You should see the contents of the embed code as before
Actual result: The form fails validation, with the error message "Invalid URL or embed code"