[wp-trac] [WordPress Trac] #30866: wordpress-Importer plugin xml parser unit testing fail.

WordPress Trac noreply at wordpress.org
Fri Mar 20 03:59:22 UTC 2015


#30866: wordpress-Importer plugin xml parser unit testing fail.
--------------------------+------------------------------
 Reporter:  edwardkim     |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Import        |     Version:  4.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+------------------------------
Changes (by ianmjones):

 * keywords:  reporter-feedback => has-patch


Comment:

 @boonebgorges I have the same problem as @edwardkim, 100% when running the
 unit tests with MAMP Pro.

 I've refreshed and slightly updated the patch, it looks good to me and
 works well.

 The reason that the checks for being in the tag are needed is documented
 in the comments for `xml_set_character_data_handler` by quite a few people
 hitting the same or related problems (http://php.net/manual/en/function
 .xml-set-character-data-handler.php).

 The reason why the `data()` function concatenates the return rather than
 overwriting is the same reason that every call should not trim the data,
 the handler for `xml_set_character_data_handler` may be called multiple
 times for the same element depending on various circumstances that split
 the string. Non-ascii characters tend to trigger the breaking up of the
 contents and multiple iterations, but for some reason MAMP Pro's current
 build of PHP seems to split the calls at a relatively short string length
 that causes the issue to arise for me in the unit tests if the data is
 always trimmed.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/30866#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list