Bug #55146 [Opn]: iconv_mime_decode_headers() skips some headers

2011-07-16 Thread dmitry at spamexperts dot com
Edit report at https://bugs.php.net/bug.php?id=55146edit=1

 ID: 55146
 User updated by:dmitry at spamexperts dot com
 Reported by:dmitry at spamexperts dot com
 Summary:iconv_mime_decode_headers() skips some headers
 Status: Open
 Type:   Bug
 Package:ICONV related
 Operating System:   Debian Squeeze
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

The whole application is using UTF-8 encoding, also if I add 

iconv_set_encoding('internal_encoding', 'UTF-8');
iconv_set_encoding('input_encoding', 'UTF-8');
iconv_set_encoding('output_encoding', 'UTF-8');

at the beginning of the test script the bug is still actual. Hope that helps, 
if 
not - feel free to ask me for any info you need.

Thanks!


Previous Comments:

[2011-07-16 01:33:38] lonnyk at gmail dot com

I am trying to test/fix this, but I do not know what encoding you are trying to 
decode this to. Can you please let us know what encoding you are trying to 
decode 
the headers to?

Thank you!


[2011-07-06 08:49:14] dmitry at spamexperts dot com

Description:

If ICONV_MIME_DECODE_CONTINUE_ON_ERROR mode is switched on the 
mime_decode_headers() function parses well-formed headers wrongly. Using of 
ICONV_MIME_DECODE_STRICT mode solve the problem.

Test script:
---
?php

$headers =  HEADERS
X-Header-One: H4sIA+NgFlsCAAA=
X-Header-Two: XtLePq6GTMn8G68F0
HEADERS;

echo 'Wrong decoding:br /pre';
var_dump(iconv_mime_decode_headers($headers, 
ICONV_MIME_DECODE_CONTINUE_ON_ERROR));
echo '/pre';

echo 'Correct decoding:br /pre';
var_dump(iconv_mime_decode_headers($headers, ICONV_MIME_DECODE_STRICT));
echo '/pre';


Expected result:

Expected result is shown in the test script under Correct decoding.

Actual result:
--
One header is missing from the result






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=55146edit=1


Bug #55146 [Opn]: iconv_mime_decode_headers() skips some headers

2011-07-16 Thread dmitry at spamexperts dot com
Edit report at https://bugs.php.net/bug.php?id=55146edit=1

 ID: 55146
 User updated by:dmitry at spamexperts dot com
 Reported by:dmitry at spamexperts dot com
 Summary:iconv_mime_decode_headers() skips some headers
 Status: Open
 Type:   Bug
 Package:ICONV related
 Operating System:   Debian Squeeze
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

If you mean encoding of the X-Header-One header contents 
(H4sIA+NgFlsCAAA=) - that's just a random set of chars.


Previous Comments:

[2011-07-16 04:53:55] dmitry at spamexperts dot com

The whole application is using UTF-8 encoding, also if I add 

iconv_set_encoding('internal_encoding', 'UTF-8');
iconv_set_encoding('input_encoding', 'UTF-8');
iconv_set_encoding('output_encoding', 'UTF-8');

at the beginning of the test script the bug is still actual. Hope that helps, 
if 
not - feel free to ask me for any info you need.

Thanks!


[2011-07-16 01:33:38] lonnyk at gmail dot com

I am trying to test/fix this, but I do not know what encoding you are trying to 
decode this to. Can you please let us know what encoding you are trying to 
decode 
the headers to?

Thank you!


[2011-07-06 08:49:14] dmitry at spamexperts dot com

Description:

If ICONV_MIME_DECODE_CONTINUE_ON_ERROR mode is switched on the 
mime_decode_headers() function parses well-formed headers wrongly. Using of 
ICONV_MIME_DECODE_STRICT mode solve the problem.

Test script:
---
?php

$headers =  HEADERS
X-Header-One: H4sIA+NgFlsCAAA=
X-Header-Two: XtLePq6GTMn8G68F0
HEADERS;

echo 'Wrong decoding:br /pre';
var_dump(iconv_mime_decode_headers($headers, 
ICONV_MIME_DECODE_CONTINUE_ON_ERROR));
echo '/pre';

echo 'Correct decoding:br /pre';
var_dump(iconv_mime_decode_headers($headers, ICONV_MIME_DECODE_STRICT));
echo '/pre';


Expected result:

Expected result is shown in the test script under Correct decoding.

Actual result:
--
One header is missing from the result






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=55146edit=1


[PHP-BUG] Bug #55146 [NEW]: iconv_mime_decode_headers() skips some headers

2011-07-06 Thread dmitry at spamexperts dot com
From: 
Operating system: Debian Squeeze
PHP version:  Irrelevant
Package:  ICONV related
Bug Type: Bug
Bug description:iconv_mime_decode_headers() skips some headers

Description:

If ICONV_MIME_DECODE_CONTINUE_ON_ERROR mode is switched on the
mime_decode_headers() function parses well-formed headers wrongly. Using of
ICONV_MIME_DECODE_STRICT mode solve the problem.

Test script:
---
?php

$headers =  HEADERS
X-Header-One: H4sIA+NgFlsCAAA=
X-Header-Two: XtLePq6GTMn8G68F0
HEADERS;

echo 'Wrong decoding:br /pre';
var_dump(iconv_mime_decode_headers($headers,
ICONV_MIME_DECODE_CONTINUE_ON_ERROR));
echo '/pre';

echo 'Correct decoding:br /pre';
var_dump(iconv_mime_decode_headers($headers, ICONV_MIME_DECODE_STRICT));
echo '/pre';


Expected result:

Expected result is shown in the test script under Correct decoding.

Actual result:
--
One header is missing from the result

-- 
Edit bug report at https://bugs.php.net/bug.php?id=55146edit=1
-- 
Try a snapshot (PHP 5.2):
https://bugs.php.net/fix.php?id=55146r=trysnapshot52
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=55146r=trysnapshot53
Try a snapshot (trunk):  
https://bugs.php.net/fix.php?id=55146r=trysnapshottrunk
Fixed in SVN:
https://bugs.php.net/fix.php?id=55146r=fixed
Fixed in SVN and need be documented: 
https://bugs.php.net/fix.php?id=55146r=needdocs
Fixed in release:
https://bugs.php.net/fix.php?id=55146r=alreadyfixed
Need backtrace:  
https://bugs.php.net/fix.php?id=55146r=needtrace
Need Reproduce Script:   
https://bugs.php.net/fix.php?id=55146r=needscript
Try newer version:   
https://bugs.php.net/fix.php?id=55146r=oldversion
Not developer issue: 
https://bugs.php.net/fix.php?id=55146r=support
Expected behavior:   
https://bugs.php.net/fix.php?id=55146r=notwrong
Not enough info: 
https://bugs.php.net/fix.php?id=55146r=notenoughinfo
Submitted twice: 
https://bugs.php.net/fix.php?id=55146r=submittedtwice
register_globals:
https://bugs.php.net/fix.php?id=55146r=globals
PHP 4 support discontinued:  
https://bugs.php.net/fix.php?id=55146r=php4
Daylight Savings:https://bugs.php.net/fix.php?id=55146r=dst
IIS Stability:   
https://bugs.php.net/fix.php?id=55146r=isapi
Install GNU Sed: 
https://bugs.php.net/fix.php?id=55146r=gnused
Floating point limitations:  
https://bugs.php.net/fix.php?id=55146r=float
No Zend Extensions:  
https://bugs.php.net/fix.php?id=55146r=nozend
MySQL Configuration Error:   
https://bugs.php.net/fix.php?id=55146r=mysqlcfg
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=55146r=trysnapshot54