|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2000-07-05 00:59 UTC] rasmus at cvs dot php dot net
[2000-07-05 13:03 UTC] stas at cvs dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Dec 17 18:00:01 2025 UTC |
I can reproduce this on 3.0.14 as a module and as a standalone cgi. Just run for extra entertainment. It ocassionally explodes my Netscape too - is apache not too graceful on handling SEGVs in modules? <? function decode_mime_string ($string) { global $i; if (eregi("=?([A-Z,0-9,-]+)?([A-Z,0-9,-]+)?([A-Z,0-9,-,=,_]+)?=", $string)) { if (ereg("^=?", $string)) $str = ' ' . $string; $coded_strings = explode(' =?', $string); $counter = 1; echo "\n\nthis is the string --$string-- and this is $i"; var_dump($coded_strings); echo "\n\n"; $string = $coded_strings[0]; /* add non encoded text that is before the encoding */ while ($counter < sizeof($coded_strings)) { $elements = explode('?', $coded_strings[$counter]); /* part 0 = charset */ /* part 1 == encoding */ /* part 2 == encoded part */ /* part 3 == unencoded part beginning with a = */ /* How can we use the charset information? */ if (eregi("Q", $elements[1])) { $elements[2] = str_replace('_', ' ', $elements[2]); $elements[2] = eregi_replace("=([A-F,0-9]{2})", "%\\1", $elements[2]); $string .= urldecode($elements[2]); } else { /* we should check for B the only valid encoding other then Q */ $elements[2] = str_replace('=', '', $elements[2]); if ($elements[2]) { $string .= base64_decode($elements[2]); } } if (isset($elements[3]) && $elements[3] != '') { $elements[3] = ereg_replace("^=", '', $elements[3]); $string .= $elements[3]; } $counter++; } } return $string; } for ( $i = 1; $i < 35 ; $i++) { decode_mime_string("[brain] =?iso-8859-1?B?RWR1Y2Hn428g4CBEaXN04m5jaWE=?="); } echo "Done."; ?>