[wp-trac] [WordPress Trac] #18953: String index handling mistake in TinyMCE's JSON.php causes a PHP "Notice" message
WordPress Trac
wp-trac at lists.automattic.com
Fri Oct 14 21:42:55 UTC 2011
#18953: String index handling mistake in TinyMCE's JSON.php causes a PHP "Notice"
message
--------------------------+-----------------------------
Reporter: carlosman | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: TinyMCE | Version: 3.2.1
Severity: trivial | Keywords:
--------------------------+-----------------------------
In the SpellChecker plugin for TinyMCE with a PHP backend, in file
JSON.php, in lines 332 ("read" function) and 350 ("peek" function), the
$this->_data string index ($this->_pos) is compared with $this->_data
string length ($this->_len). These allow errors in lines 339 and 351 of
their respective functions, when the $this->_pos index gets to be equal to
the length of the string. This situation generates the following messages
to show up in PHP servers configured to show notice-level debug
information:
Notice: Uninitialized string offset: <length of _data> in <WordPress path
>/wp-includes/js/tinymce/plugins/spellchecker/classes/utils/JSON.php on
line 351
Notice: Uninitialized string offset: <length of _data> in <WordPress path
>/wp-includes/js/tinymce/plugins/spellchecker/classes/utils/JSON.php on
line 339
I will attach a patch file to illustrate how I solved this situation.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/18953>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list