#32473 [Opn->Csd]: base64_encode cuts text - input to 2933 Characters
ID: 32473 User updated by: f-bischof at versanet dot de Reported By: f-bischof at versanet dot de -Status: Open +Status: Closed Bug Type: Apache related Operating System: Win XP Sp2 PHP Version: PHP Version 4.3.11RC2-dev New Comment: Sorry, i am stupid !! Changing the value of the odbc.defaultlrl in the php.ini to: odbc.defaultlrl = 30 ...fixed my problem... Ouch. Previous Comments: [2005-03-29 20:26:14] f-bischof at versanet dot de I have made some additionally tests, to write a workaround for this problem !!! Instead of using base64_decode/encode i have replaced all ' with '' in the $text - string to avoid trouble with the sql-insert command. This showed me, that the bug resists, even with not using base64_encode / decode functions. If i insert a big $text - String in the database, the database (MS-Access) stores this Text completely in the Table. But if i select the Text out of the database i got not the complete text like it is in the Database, its truncated after about 3KB. I think the problem is in the mysql_odbc functions. Here a code snipplet: $connect = odbc_connect("astaBB","",""); $query = "SELECT NachrichtsID,User,Datum,TextN,Email from Nachrichten,Login where NachrichtsID=$NachrichtsID and User='$username'"; # perform the query $result = odbc_exec($connect, $query); # fetch the data from the database while(odbc_fetch_row($result)) { $NachrichtsID=odbc_result($result, 1); $User=odbc_result($result, 2); $Datum=odbc_result($result, 3); $Text=odbc_result($result, 4); $email=odbc_result($result, 5); } $Text will be truncated after about 3KB, but the Table-Field TextN (Access-Memo Field) has the complete 4KB Text stored. -------------------- [2005-03-29 18:11:44] f-bischof at versanet dot de I have tried it with the announced latest stable version, with the same result. Truncated after 2933 Bytes length. http://snaps.php.net/win32/php4-win32-STABLE-latest.zip [2005-03-29 00:38:38] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip -------------------- [2005-03-28 16:27:02] f-bischof at versanet dot de Description: I use Apache/1.3.31 (Win32) PHP/4.3.10 mod_ssl/2.8.18 OpenSSL/0.9.7d I host a website: http://pocketwelt.dyndns.org If someone writes a forum-article that is longer then 2933 Bytes and i try to save the input (base64_encoded) in my database, and then reload the article, it´s truncated after 2933 bytes. The rest deleted... If i write the article without base64_encoding, i get so much characters in the databse like i want. The Bug seems only appear if i use base64_encoding. (also tested with PHP 5.05 with the same result...) Reproduce code: --- $text=base64_encode($text); Text should be about 4 or 5 KB to see the bug ! Expected result: Truncated Text afeter 2933 Bytes -- Edit this bug report at http://bugs.php.net/?id=32473&edit=1
#32473 [Opn]: base64_encode cuts text - input to 2933 Characters
ID: 32473 User updated by: f-bischof at versanet dot de Reported By: f-bischof at versanet dot de Status: Open Bug Type: Apache related Operating System: Win XP Sp2 PHP Version: PHP Version 4.3.11RC2-dev New Comment: I have made some additionally tests, to write a workaround for this problem !!! Instead of using base64_decode/encode i have replaced all ' with '' in the $text - string to avoid trouble with the sql-insert command. This showed me, that the bug resists, even with not using base64_encode / decode functions. If i insert a big $text - String in the database, the database (MS-Access) stores this Text completely in the Table. But if i select the Text out of the database i got not the complete text like it is in the Database, its truncated after about 3KB. I think the problem is in the mysql_odbc functions. Here a code snipplet: $connect = odbc_connect("astaBB","",""); $query = "SELECT NachrichtsID,User,Datum,TextN,Email from Nachrichten,Login where NachrichtsID=$NachrichtsID and User='$username'"; # perform the query $result = odbc_exec($connect, $query); # fetch the data from the database while(odbc_fetch_row($result)) { $NachrichtsID=odbc_result($result, 1); $User=odbc_result($result, 2); $Datum=odbc_result($result, 3); $Text=odbc_result($result, 4); $email=odbc_result($result, 5); } $Text will be truncated after about 3KB, but the Table-Field TextN (Access-Memo Field) has the complete 4KB Text stored. Previous Comments: -------------------- [2005-03-29 18:11:44] f-bischof at versanet dot de I have tried it with the announced latest stable version, with the same result. Truncated after 2933 Bytes length. http://snaps.php.net/win32/php4-win32-STABLE-latest.zip [2005-03-29 00:38:38] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip -------------------- [2005-03-28 16:27:02] f-bischof at versanet dot de Description: I use Apache/1.3.31 (Win32) PHP/4.3.10 mod_ssl/2.8.18 OpenSSL/0.9.7d I host a website: http://pocketwelt.dyndns.org If someone writes a forum-article that is longer then 2933 Bytes and i try to save the input (base64_encoded) in my database, and then reload the article, it´s truncated after 2933 bytes. The rest deleted... If i write the article without base64_encoding, i get so much characters in the databse like i want. The Bug seems only appear if i use base64_encoding. (also tested with PHP 5.05 with the same result...) Reproduce code: --- $text=base64_encode($text); Text should be about 4 or 5 KB to see the bug ! Expected result: Truncated Text afeter 2933 Bytes -- Edit this bug report at http://bugs.php.net/?id=32473&edit=1
#32473 [Fbk->Opn]: base64_encode cuts text - input to 2933 Characters
ID: 32473 User updated by: f-bischof at versanet dot de Reported By: f-bischof at versanet dot de -Status: Feedback +Status: Open Bug Type: Apache related Operating System: Win XP Sp2 -PHP Version: 4.3.10 +PHP Version: PHP Version 4.3.11RC2-dev New Comment: I have tried it with the announced latest stable version, with the same result. Truncated after 2933 Bytes length. http://snaps.php.net/win32/php4-win32-STABLE-latest.zip Previous Comments: [2005-03-29 00:38:38] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php4-STABLE-latest.tar.gz For Windows: http://snaps.php.net/win32/php4-win32-STABLE-latest.zip [2005-03-28 16:27:02] f-bischof at versanet dot de Description: I use Apache/1.3.31 (Win32) PHP/4.3.10 mod_ssl/2.8.18 OpenSSL/0.9.7d I host a website: http://pocketwelt.dyndns.org If someone writes a forum-article that is longer then 2933 Bytes and i try to save the input (base64_encoded) in my database, and then reload the article, it´s truncated after 2933 bytes. The rest deleted... If i write the article without base64_encoding, i get so much characters in the databse like i want. The Bug seems only appear if i use base64_encoding. (also tested with PHP 5.05 with the same result...) Reproduce code: --- $text=base64_encode($text); Text should be about 4 or 5 KB to see the bug ! Expected result: Truncated Text afeter 2933 Bytes -- Edit this bug report at http://bugs.php.net/?id=32473&edit=1
#32473 [NEW]: base64_encode cuts text - input to 2933 Characters
From: f-bischof at versanet dot de Operating system: Win XP Sp2 PHP version: 4.3.10 PHP Bug Type: Apache related Bug description: base64_encode cuts text - input to 2933 Characters Description: I use Apache/1.3.31 (Win32) PHP/4.3.10 mod_ssl/2.8.18 OpenSSL/0.9.7d I host a website: http://pocketwelt.dyndns.org If someone writes a forum-article that is longer then 2933 Bytes and i try to save the input (base64_encoded) in my database, and then reload the article, it´s truncated after 2933 bytes. The rest deleted... If i write the article without base64_encoding, i get so much characters in the databse like i want. The Bug seems only appear if i use base64_encoding. (also tested with PHP 5.05 with the same result...) Reproduce code: --- $text=base64_encode($text); Text should be about 4 or 5 KB to see the bug ! Expected result: Truncated Text afeter 2933 Bytes -- Edit bug report at http://bugs.php.net/?id=32473&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=32473&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=32473&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=32473&r=trysnapshot51 Fixed in CVS:http://bugs.php.net/fix.php?id=32473&r=fixedcvs Fixed in release:http://bugs.php.net/fix.php?id=32473&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=32473&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=32473&r=needscript Try newer version: http://bugs.php.net/fix.php?id=32473&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=32473&r=support Expected behavior: http://bugs.php.net/fix.php?id=32473&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=32473&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=32473&r=submittedtwice register_globals:http://bugs.php.net/fix.php?id=32473&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=32473&r=php3 Daylight Savings:http://bugs.php.net/fix.php?id=32473&r=dst IIS Stability: http://bugs.php.net/fix.php?id=32473&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=32473&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=32473&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=32473&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=32473&r=mysqlcfg