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

WordPress Trac noreply at wordpress.org
Fri Aug 19 03:15:37 UTC 2016


#30866: wordpress-Importer plugin xml parser unit testing fail.
-------------------------------------+----------------------------
 Reporter:  edwardkim                |       Owner:
     Type:  defect (bug)             |      Status:  closed
 Priority:  normal                   |   Milestone:  WordPress.org
Component:  Import                   |     Version:  4.1
 Severity:  normal                   |  Resolution:  fixed
 Keywords:  has-patch needs-testing  |     Focuses:
-------------------------------------+----------------------------
Changes (by boonebgorges):

 * status:  new => closed
 * resolution:   => fixed
 * milestone:  Awaiting Review => WordPress.org


Comment:

 Replying to [comment:4 ianmjones]:
 > @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.

 Sorry for the delay in responding, @ianmjones. This reasoning makes sense
 to me. Fixed in https://github.com/boonebgorges/wordpress-
 importer/commit/6a59d32740edbea9e7ec174a47362b985716b139 and it will be
 part of the next release.

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


More information about the wp-trac mailing list