Commit c224115f authored by Son Nguyen's avatar Son Nguyen Committed by Robert Lyon

Bug 1618317: Validate urlquerystr before parsing

Also update the tinymce/README.Mahara as TinyMCE imagebrowser plugin
is a part of mahara

behatnotneeded

Change-Id: Ie6d3aa1bf80db9f9d52e3373bf407ab6bf8cafad
(cherry picked from commit e99d7b50)
(cherry picked from commit 7fe94c02)
parent f74fa071
......@@ -15,4 +15,5 @@ Changes:
* Added code to spellchecker/spellchecker.rpc to use $CFG->spellcheckerengine
* Adjusted the charmap plugin to contain Māori macrons
* Adding the 'aria-hidden="true"' to presentation icons
* Bug 1605110: Modified the "table" plugin to style the table through CSS instead of HTML attributes
\ No newline at end of file
* Bug 1605110: Modified the "table" plugin to style the table through CSS instead of HTML attributes
* Add TinyMCE imagebrowser plugin: plugins/imagebrowser/plugin.js
\ No newline at end of file
......@@ -34,11 +34,14 @@ tinymce.PluginManager.add('imagebrowser', function(editor) {
var selected = null;
if (imgElm.nodeName == 'IMG' && !imgElm.getAttribute('data-mce-object') && !imgElm.getAttribute('data-mce-placeholder')) {
// existing values
var urlquerystr = dom.getAttrib(imgElm, 'src').match(/\?.+/)[0];
var urlparts = urlquerystr.split('&');
for (var x in urlparts) {
if (urlparts[x].match('file=')) {
selected = urlparts[x].split('=')[1];
var urlquerystr = dom.getAttrib(imgElm, 'src').match(/\?.+/);
if (urlquerystr) {
urlquerystr = urlquerystr[0];
var urlparts = urlquerystr.split('&');
for (var x in urlparts) {
if (urlparts[x].match('file=')) {
selected = urlparts[x].split('=')[1];
}
}
}
data = {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment