WordPress.org

Make WordPress Core

Changeset 21232


Ignore:
Timestamp:
07/08/2012 09:11:23 PM (6 years ago)
Author:
azaozz
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/js/tinymce/plugins/wpeditimage/editor_plugin_src.js

    r20679 r21232  
    143143
    144144                id = b.match(/id=['"]([^'"]*)['"] ?/);
    145                 b = b.replace(id[0], '');
     145                if ( id )
     146                    b = b.replace(id[0], '');
    146147
    147148                cls = b.match(/align=['"]([^'"]*)['"] ?/);
    148                 b = b.replace(cls[0], '');
     149                if ( cls )
     150                    b = b.replace(cls[0], '');
    149151
    150152                w = b.match(/width=['"]([0-9]*)['"] ?/);
    151                 b = b.replace(w[0], '');
     153                if ( w )
     154                    b = b.replace(w[0], '');
    152155
    153156                c = trim(c);
Note: See TracChangeset for help on using the changeset viewer.