#34027 [Opn->Bgs]: new line unix "\n" in hidden html are not recorded
| From: | derick@php.net | Date: | Sun, 07 Aug 2005 15:20:16 +0000 |
| Subject: | #34027 [Opn->Bgs]: new line unix "\n" in hidden html are not recorded | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-83137@lists.php.net to get a copy of this message | ||
ID: 34027
Updated by: derick@php.net
Reported By: test2 at nicolap dot lautre dot net
-Status: Open
+Status: Bogus
Bug Type: Safe Mode/open_basedir
Operating System: linux
PHP Version: 5.0.4
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
.
Previous Comments:
------------------------------------------------------------------------
[2005-08-07 17:05:24] test2 at nicolap dot lautre dot net
Description:
------------
Hello,
run the following script and enter in the text area the
value :
line 1
line 2
<?php
$out .= '<form action="test3.php" method="post">';
$out .= '<textarea name="body" rows="10" cols="70">';
if (isset($_POST['body'])) {
$out .= $_POST['body'];
$out .= '</textarea><br /><br />'."\n";
} else {
$out .= '</textarea><br /><br />'."\n";
}
if (isset($_POST['body2']) && !empty($_POST['body2'])) {
if (strcmp($body, $body2)) {
$out .= "strings are the same !";
} else {
$out .= "strings are not the same !<br/>".
$_POST['body']."<br/>".
$_POST['body2']."<br/>";
}
} else {
$out .= '<input type="hidden" name="body2"'.'
value="'.$_POST['body'].'">'."\n";
}
$out .= '<input type="submit" name="submit" value
="record">';
$out .= "</form>";
echo $out;
?>
It always shows the same thing : "strings are not the
same !" . The character new line "\n" is not recorded when
it is coming from a hidden tag in html form.
I am using safe_mode and php 5.0.4.
Nicolas
Reproduce code:
---------------
<?php
$out .= '<form action="test3.php" method="post">';
$out .= '<textarea name="body" rows="10" cols="70">';
if (isset($_POST['body'])) {
$out .= $_POST['body'];
$out .= '</textarea><br /><br />'."\n";
} else {
$out .= '</textarea><br /><br />'."\n";
}
if (isset($_POST['body2']) && !empty($_POST['body2'])) {
if (strcmp($body, $body2)) {
$out .= "strings are the same !";
} else {
$out .= "strings are not the same !<br/>".
$_POST['body']."<br/>".
$_POST['body2']."<br/>";
}
} else {
$out .= '<input type="hidden" name="body2"'.'
value="'.$_POST['body'].'">'."\n";
}
$out .= '<input type="submit" name="submit" value
="record">';
$out .= "</form>";
echo $out;
?>
Expected result:
----------------
If you enter the 2 following lines in the text area :
line1
line2
The result of the script always shows :
strings are not the same !
line1 line2
line1 line2
Out that should show this :
strings are the same !
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=34027&edit=1