Thread: [ postfixadmin-Bugs-1927706 ] cannot yet handle MBCS in html_entity_decode
Brought to you by:
christian_boltz,
gingerdog
From: SourceForge.net <no...@so...> - 2008-03-28 03:47:36
|
Bugs item #1927706, was opened at 2008-03-27 20:47 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=937964&aid=1927706&group_id=191583 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Vacation Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Master Merlin Kull Kirkpatrick (thefathermind) Assigned to: Nobody/Anonymous (nobody) Summary: cannot yet handle MBCS in html_entity_decode Initial Comment: In the vacation module I got this error about 200 times.. "cannot yet handle MBCS in html_entity_decode" This is a documented bug in the 4.3 versions of PHP that they say they are not going to resolve stated here... http://bugs.php.net/bug.php?id=25670 I implemented the following work around to resolve this... in common.php I added the following 2 functions... // Returns the utf string corresponding to the unicode value (from php.net, courtesy - ro...@vo...) function code2utf($num) { if ($num < 128) return chr($num); if ($num < 2048) return chr(($num >> 6) + 192) . chr(($num & 63) + 128); if ($num < 65536) return chr(($num >> 12) + 224) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128); if ($num < 2097152) return chr(($num >> 18) + 240) . chr((($num >> 12) & 63) + 128) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128); return ''; } function html_entity_decode_fixed($str) { return preg_replace('/&#(\\d+);/e', 'code2utf($1)', utf8_encode($str)); } Then I edited edit-vacation.php and users/vacation.php and replaced all "html_entity_decode" with "html_entity_decode_fixed" ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=937964&aid=1927706&group_id=191583 |
From: SourceForge.net <no...@so...> - 2008-04-25 23:26:28
|
Bugs item #1927706, was opened at 2008-03-28 04:47 Message generated for change (Comment added) made by christian_boltz You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=937964&aid=1927706&group_id=191583 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Vacation Group: None Status: Open Resolution: None >Priority: 2 Private: No Submitted By: Master Merlin Kull Kirkpatrick (thefathermind) Assigned to: Nobody/Anonymous (nobody) Summary: cannot yet handle MBCS in html_entity_decode Initial Comment: In the vacation module I got this error about 200 times.. "cannot yet handle MBCS in html_entity_decode" This is a documented bug in the 4.3 versions of PHP that they say they are not going to resolve stated here... http://bugs.php.net/bug.php?id=25670 I implemented the following work around to resolve this... in common.php I added the following 2 functions... // Returns the utf string corresponding to the unicode value (from php.net, courtesy - ro...@vo...) function code2utf($num) { if ($num < 128) return chr($num); if ($num < 2048) return chr(($num >> 6) + 192) . chr(($num & 63) + 128); if ($num < 65536) return chr(($num >> 12) + 224) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128); if ($num < 2097152) return chr(($num >> 18) + 240) . chr((($num >> 12) & 63) + 128) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128); return ''; } function html_entity_decode_fixed($str) { return preg_replace('/&#(\\d+);/e', 'code2utf($1)', utf8_encode($str)); } Then I edited edit-vacation.php and users/vacation.php and replaced all "html_entity_decode" with "html_entity_decode_fixed" ---------------------------------------------------------------------- >Comment By: Christian Boltz (christian_boltz) Date: 2008-04-26 01:26 Message: Logged In: YES user_id=593261 Originator: NO I'm not sure if we can include a workaround for every PHP bug ;-) - especially if we are talking about PHP 4 bugs. I'd vote for "wontfix" here - Gingerdog, what do you think? I'd recommend to upgrade to PHP 5 (or at least to the very latest PHP 4 (4.4.8) version if you have special reasons not to upgrade to PHP 5). PHP 4 is no longer maintained by the PHP developers (since 2007-12-31). As long as you can't or don't want to upgrade PHP, feel free to use your patched version of Postfixadmin ;-) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=937964&aid=1927706&group_id=191583 |
From: SourceForge.net <no...@so...> - 2008-04-26 07:15:08
|
Bugs item #1927706, was opened at 2008-03-28 03:47 Message generated for change (Comment added) made by gingerdog You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=937964&aid=1927706&group_id=191583 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Vacation Group: None >Status: Closed >Resolution: Wont Fix Priority: 2 Private: No Submitted By: Master Merlin Kull Kirkpatrick (thefathermind) Assigned to: Nobody/Anonymous (nobody) Summary: cannot yet handle MBCS in html_entity_decode Initial Comment: In the vacation module I got this error about 200 times.. "cannot yet handle MBCS in html_entity_decode" This is a documented bug in the 4.3 versions of PHP that they say they are not going to resolve stated here... http://bugs.php.net/bug.php?id=25670 I implemented the following work around to resolve this... in common.php I added the following 2 functions... // Returns the utf string corresponding to the unicode value (from php.net, courtesy - ro...@vo...) function code2utf($num) { if ($num < 128) return chr($num); if ($num < 2048) return chr(($num >> 6) + 192) . chr(($num & 63) + 128); if ($num < 65536) return chr(($num >> 12) + 224) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128); if ($num < 2097152) return chr(($num >> 18) + 240) . chr((($num >> 12) & 63) + 128) . chr((($num >> 6) & 63) + 128) . chr(($num & 63) + 128); return ''; } function html_entity_decode_fixed($str) { return preg_replace('/&#(\\d+);/e', 'code2utf($1)', utf8_encode($str)); } Then I edited edit-vacation.php and users/vacation.php and replaced all "html_entity_decode" with "html_entity_decode_fixed" ---------------------------------------------------------------------- >Comment By: GingerDog (gingerdog) Date: 2008-04-26 07:15 Message: Logged In: YES user_id=1761957 Originator: NO I vote for wontfix too. ---------------------------------------------------------------------- Comment By: Christian Boltz (christian_boltz) Date: 2008-04-25 23:26 Message: Logged In: YES user_id=593261 Originator: NO I'm not sure if we can include a workaround for every PHP bug ;-) - especially if we are talking about PHP 4 bugs. I'd vote for "wontfix" here - Gingerdog, what do you think? I'd recommend to upgrade to PHP 5 (or at least to the very latest PHP 4 (4.4.8) version if you have special reasons not to upgrade to PHP 5). PHP 4 is no longer maintained by the PHP developers (since 2007-12-31). As long as you can't or don't want to upgrade PHP, feel free to use your patched version of Postfixadmin ;-) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=937964&aid=1927706&group_id=191583 |