TinyMCE: don't throw fatal errors for malformed/invalid image caption shortcodes, props SergeyBiryukov, see #21145
git-svn-id: http://core.svn.wordpress.org/trunk@21232 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
251719c5e5
commit
851db96416
|
@ -142,13 +142,16 @@
|
|||
var id, cls, w, cap, div_cls, img, trim = tinymce.trim;
|
||||
|
||||
id = b.match(/id=['"]([^'"]*)['"] ?/);
|
||||
b = b.replace(id[0], '');
|
||||
if ( id )
|
||||
b = b.replace(id[0], '');
|
||||
|
||||
cls = b.match(/align=['"]([^'"]*)['"] ?/);
|
||||
b = b.replace(cls[0], '');
|
||||
if ( cls )
|
||||
b = b.replace(cls[0], '');
|
||||
|
||||
w = b.match(/width=['"]([0-9]*)['"] ?/);
|
||||
b = b.replace(w[0], '');
|
||||
if ( w )
|
||||
b = b.replace(w[0], '');
|
||||
|
||||
c = trim(c);
|
||||
img = c.match(/((?:<a [^>]+>)?<img [^>]+>(?:<\/a>)?)([\s\S]*)/i);
|
||||
|
|
Loading…
Reference in New Issue