mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX: Sensitized TinyMCE text selection that brought html tags into Link text field which caused javascript error in IE browsers (fixes #6589)
This commit is contained in:
parent
601665519b
commit
d02c3cbdba
11
javascript/tiny_mce_improvements.js
vendored
11
javascript/tiny_mce_improvements.js
vendored
@ -146,7 +146,8 @@ LinkForm.prototype = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
respondToNodeChange: function(ed) {
|
respondToNodeChange: function(ed) {
|
||||||
if(ed == null) ed = tinyMCE.activeEditor;
|
var htmlTagPattern = /<\S[^><]*>/g;
|
||||||
|
if(ed == null) ed = tinyMCE.activeEditor;
|
||||||
|
|
||||||
if(this.style.display == 'block') {
|
if(this.style.display == 'block') {
|
||||||
var i,data = this.getCurrentLink(ed);
|
var i,data = this.getCurrentLink(ed);
|
||||||
@ -154,7 +155,13 @@ LinkForm.prototype = {
|
|||||||
if(data) {
|
if(data) {
|
||||||
for(i in data) {
|
for(i in data) {
|
||||||
if(this.elements[i]) {
|
if(this.elements[i]) {
|
||||||
Form.Element.setValue(this.elements[i], data[i]);
|
var selected = data[i];
|
||||||
|
// Remove html tags in the selected text that occurs on IE browsers
|
||||||
|
if(typeof(selected) == 'string') {
|
||||||
|
selected = selected.replace(htmlTagPattern, '');
|
||||||
|
}
|
||||||
|
|
||||||
|
Form.Element.setValue(this.elements[i], selected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user