From e7d3a9a26c0dec5a05ab5263209f7b35ce38c981 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Tue, 14 Oct 2014 01:25:32 +0000 Subject: [PATCH] Quicktags: fix strict check for `instance['0']`, props afercia, fixes #29767 git-svn-id: https://develop.svn.wordpress.org/trunk@29889 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/quicktags.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/js/quicktags.js b/src/wp-includes/js/quicktags.js index 026c2b28f4..ee3e658044 100644 --- a/src/wp-includes/js/quicktags.js +++ b/src/wp-includes/js/quicktags.js @@ -230,8 +230,8 @@ function edButton(id, display, tagStart, tagEnd, access) { qt.instances[id] = t; - if ( !qt.instances[0] ) { - qt.instances[0] = qt.instances[id]; + if ( ! qt.instances['0'] ) { + qt.instances['0'] = qt.instances[id]; _domReady( function(){ qt._buttonsInit(); } ); } }; @@ -247,7 +247,7 @@ function edButton(id, display, tagStart, tagEnd, access) { defaults = ',strong,em,link,block,del,ins,img,ul,ol,li,code,more,close,'; for ( inst in t.instances ) { - if ( inst === 0 ) { + if ( '0' === inst ) { continue; } @@ -323,7 +323,7 @@ function edButton(id, display, tagStart, tagEnd, access) { * @param string access_key Deprecated Not used * @param string title Optional. Button's title="..." * @param int priority Optional. Number representing the desired position of the button in the toolbar. 1 - 9 = first, 11 - 19 = second, 21 - 29 = third, etc. - * @param string instance Optional. Limit the button to a specifric instance of Quicktags, add to all instances if not present. + * @param string instance Optional. Limit the button to a specific instance of Quicktags, add to all instances if not present. * @return mixed null or the button object that is needed for back-compat. */ qt.addButton = function( id, display, arg1, arg2, access_key, title, priority, instance ) {