TinyMCE: don't throw fatal errors for malformed/invalid image caption shortcodes, props SergeyBiryukov, see #21145

git-svn-id: https://develop.svn.wordpress.org/trunk@21232 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2012-07-08 21:11:23 +00:00
parent fc9df89100
commit 23cbfec581
1 changed files with 6 additions and 3 deletions

View File

@ -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);