#34056 [Opn-Fbk]: Passing a string variable results in incorrect length

2005-10-09 Thread sniper
 ID:   34056
 Updated by:   [EMAIL PROTECTED]
 Reported By:  David at Caulkett dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Strings related
 Operating System: Linux 2.4.22-1.2199.nptlsmp
 PHP Version:  4.3.11
 New Comment:

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

Either you try the snapshot or provide short example script.
(one file only!!)



Previous Comments:


[2005-10-09 15:17:11] David at Caulkett dot com

The problem ocurred on a server handled by http://support.coastinc.com/
 PHP version is 4.3.10 .

I am unable to provide a snapshot of the server.

The test case is simple and hard demonstrable at
http://www.reportillegals.com/test1.php.  

IMHO, either PHP has a bug or the PHP installation is bad.  My guess is
there is a PHP bug.



[2005-08-17 01:00:04] php-bugs at lists dot php dot net

No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to Open.



[2005-08-09 22:58:32] [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-08-09 20:40:21] David at Caulkett dot com

Description:

Actually PHP is version 4.3.10.
Passing a string variable from test1 to test2 works fine.  Passing the
same string from test2 to test3 results in an incorrect length.  The
length is 30 greater than it should be.  PHP seems to be padding the
string with 30 spaces which is likely the length of the original INPUT
statement.  The problem is fixed by removing the extra spaces with the
trim function.

The test programs are at:
http://www.reportillegals.com/test1.php
http://www.reportillegals.com/test2.php
http://www.reportillegals.com/test3.php

The source of the programs are at:
http://www.reportillegals.com/test1.txt
http://www.reportillegals.com/test2.txt
http://www.reportillegals.com/test3.txt





Reproduce code:
---
TEST1 CODE:
html
body
form method=POST name=emailcomments
action=http://www.reportillegals.com/test2.php;
  input type=text name=User_Email_Address 
  input type=submit value=PHP Bug Test1 - Enter email address and
remember the no. of chars
/form
/body
/html

TEST2 CODE:
html
body
?php
$length = strlen ( $User_Email_Address );
echo length= . $length;
?
form method=POST name=emailcomments
action=http://www.reportillegals.com/test3.php;
input type=hidden name=User_Email_Address value=
  ?php print $User_Email_Address;?
  
   input type=submit value=PHP Bug Test2 - Length should be what
you just entered. Just click Submit
/form
/body
/html

TEST3 CODE:
html
body
?php
$length = strlen ( $User_Email_Address );
echo length= . $length .br;
echo length is incorrect.  it is whatever you entered +30 . br;
$User_Email_Address = trim ($User_Email_Address);
$length = strlen ( $User_Email_Address );
echo length= . $length .br;
echo length is now correct after using the trim function.. br;
?
/body
/html

Expected result:

The length in test2 and test3 should be the same number of characters
as entered in test1.

Actual result:
--
The length is whatever was entered + 30.





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


#34056 [Opn-Fbk]: Passing a string variable results in incorrect length

2005-08-09 Thread sniper
 ID:   34056
 Updated by:   [EMAIL PROTECTED]
 Reported By:  David at Caulkett dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Strings related
 Operating System: Linux 2.4.22-1.2199.nptlsmp
 PHP Version:  4.3.11
 New Comment:

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




Previous Comments:


[2005-08-09 20:40:21] David at Caulkett dot com

Description:

Actually PHP is version 4.3.10.
Passing a string variable from test1 to test2 works fine.  Passing the
same string from test2 to test3 results in an incorrect length.  The
length is 30 greater than it should be.  PHP seems to be padding the
string with 30 spaces which is likely the length of the original INPUT
statement.  The problem is fixed by removing the extra spaces with the
trim function.

The test programs are at:
http://www.reportillegals.com/test1.php
http://www.reportillegals.com/test2.php
http://www.reportillegals.com/test3.php

The source of the programs are at:
http://www.reportillegals.com/test1.txt
http://www.reportillegals.com/test2.txt
http://www.reportillegals.com/test3.txt





Reproduce code:
---
TEST1 CODE:
html
body
form method=POST name=emailcomments
action=http://www.reportillegals.com/test2.php;
  input type=text name=User_Email_Address 
  input type=submit value=PHP Bug Test1 - Enter email address and
remember the no. of chars
/form
/body
/html

TEST2 CODE:
html
body
?php
$length = strlen ( $User_Email_Address );
echo length= . $length;
?
form method=POST name=emailcomments
action=http://www.reportillegals.com/test3.php;
input type=hidden name=User_Email_Address value=
  ?php print $User_Email_Address;?
  
   input type=submit value=PHP Bug Test2 - Length should be what
you just entered. Just click Submit
/form
/body
/html

TEST3 CODE:
html
body
?php
$length = strlen ( $User_Email_Address );
echo length= . $length .br;
echo length is incorrect.  it is whatever you entered +30 . br;
$User_Email_Address = trim ($User_Email_Address);
$length = strlen ( $User_Email_Address );
echo length= . $length .br;
echo length is now correct after using the trim function.. br;
?
/body
/html

Expected result:

The length in test2 and test3 should be the same number of characters
as entered in test1.

Actual result:
--
The length is whatever was entered + 30.





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