Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.0

Bug #9100 Error with nested boundaries where inner boundary is a subset of the outer
Submitted: 2006-10-19 23:31 UTC Modified: 2007-02-12 16:18 UTC
From: rocca at start dot ca Assigned:
Status: Analyzed Package: Mail_mimeDecode (version 1.3.1)
PHP Version: Irrelevant OS: All
Roadmaps: 1.6.0    
Subscription  
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes. If this is not your bug, you can add a comment by following this link. If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: rocca at start dot ca
New email:
PHP Version: Package Version: OS:

 

 [2006-10-19 23:31 UTC] rocca at start dot ca (Peter Rocca)
Description: ------------ If the input data has an inner boundary that contains a subset of the outer boundary the _boundarySplit function will incorrectly parse the data. For example: Content-Type: multipart/mixed; boundary="abc" --abc Content-Type: multipart/mixed; boundary="abc_a" --abc_a inner --abc_a-- outer --abc-- ...will return 'abc_a' as being at the same level as 'abc' and additionally create some garbage nodes. Test script: --------------- function _boundarySplit($input, $boundary) { - $tmp = explode('--' . $boundary, $input); + $tmp = preg_split("/--$boundary(\b|--)/", $input);

Comments

 [2006-11-07 09:50 UTC] rocca at start dot ca
Changing PHP/OS version to Irrelevant. Also the 'test script' is actually the diff required to fix the problem. Ie, using preg_split instead of explode.