ID: 36720 Updated by: [EMAIL PROTECTED] Reported By: astur103 at hotmail dot com -Status: Open +Status: Feedback Bug Type: Unknown/Other Function Operating System: Windows XP Pro SP2 PHP Version: 5.1.2 New Comment:
Please try using this CVS snapshot: http://snaps.php.net/php5.1-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.1-win32-latest.zip Works fine here. Previous Comments: ------------------------------------------------------------------------ [2006-03-15 17:39:47] astur103 at hotmail dot com Just a comment. I think that an important note. There are 8 consecutive queries to compress_gz function. 1.- Before 5.1.2 (Win32), I had a usleep(100000) between these 8 queries. 2.- Now I have tested that need a usleep(200000) to get that the chunk_split works fine, or at least, the combination of chunk_split(base64_encode(gzcompress, 1))) I hope this helps. Thanks Mapg ------------------------------------------------------------------------ [2006-03-13 16:24:37] astur103 at hotmail dot com Maybe problem is originated on base64_encode or gzcompress funtions, or ZLIB library. Take also in consideration that I am using level 1 of compression. With previous PHP versions, these functions worked finely, and always. Now with 5.1.2 and in my system, sometimes this bug happens. Thanks Mapg ------------------------------------------------------------------------ [2006-03-13 16:12:04] astur103 at hotmail dot com 1.- To uncompress or compress the string use ... http://www.3dspanish.org/bug_report/functions.txt 2.- To check how chunk_split cut wrongly the string check ... http://www.3dspanish.org/bug_report/bad_cut_code.txt 3.- To check the SAME string cut rightly check ... http://www.3dspanish.org/bug_report/good_cut_code.txt 4.- To know how is the inside string use function "uncompress_gz" over "good_cut_code.txt" Let me know if you need something more. Thanks Mapg ------------------------------------------------------------------------ [2006-03-13 15:48:55] [EMAIL PROTECTED] Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with <?php and ends with ?>, is max. 10-20 lines long and does not require any external resources such as databases, etc. If possible, make the script source available online and provide an URL to it here. Try to avoid embedding huge scripts into the report. ------------------------------------------------------------------------ [2006-03-13 15:41:45] astur103 at hotmail dot com Description: ------------ Sometimes, above all if memory is clean or the function is not loaded in memory and has to do it, chunk_split cut a base64 string wrongly. Later, works fine. Reproduce code: --------------- This is the used function: function compress_gz($string, $level = "1") { $final_string = ""; IF(!empty($string)) { $final_string = chunk_split(base64_encode(gzcompress($string, $level))); } return $final_string; unset($string); unset($final_string); } Expected result: ---------------- I guess that something like this ... ---- LAST 3 LINES OF STRING --- 0r5uCiYhgApgyg3dCkwmwrauUwVphDguNk2YXJFHqWtjYBAbJjL9iS4X14tgmvRNyD6ef+L3Ve3y 5eLawo1+GJjEDVylt2st73hav2fuh90XV7iJbHVZexbnfz9M2d8Yszv8AKlPYUQ== ---- END ---- Actual result: -------------- ---- LAST 3 LINES OF STRING --- 0r5uCiYhgApgyg3dCkwmwrauUwVphDguNk2YXJFHqWtjYBAbJjL9iS4X14tgmvRNyD6ef+L3Ve3y 5eLawo1+GJjEDVylt2st73hav2fuh90XV7iJbHVZexbnfz9M2d8= Yszv8AKlPYUQ== ---- END ---- ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=36720&edit=1