Re: PHP 4.0 Bug #8208: Weird behaviour
| From: | Stanislav Malyshev | Date: | Tue, 12 Dec 2000 16:54:16 +0000 |
| Subject: | Re: PHP 4.0 Bug #8208: Weird behaviour | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-41008@lists.php.net to get a copy of this message | ||
>> a) it spits back extra (whitespace) characters. For instance, I connect and type
>> "hi". I get back:
>> PHP: You said "hi"
>> PHP: You said ""
>> This always happens, until I get stuck in a loop as above.
This is normal, because read stops at \r and \n and telnet sends both. So
it stops twice.
>> b) it spits back part of the code. For instance, I changed the script to
>> $talkback = "PHP: You said '" . urlencode($buf) .
>> "'.\n";
>> I then get output like:
>> PHP: You said
>> 'foo%0D+%28true%29%3B%0A++++close+%28%24msgsock%29%3B%0A%7D+while+%28true%29%3B%0A%0Aclose+%28%24sock%29%3B%0A%3F%3E'.
>> PHP: You said ''.
>> This only happens on the first line of input. On the server side, I actually get the tail
>> end of the PHP script output.
>> c) occasionally it gets stuck in a loop. For instance, I connect and type "foo".
>> I get back:
>> PHP: You said "f"
>> PHP: You said "oo"
>> PHP: You said "oo"
>> PHP: You said "oo"
>> ...etc.
>> This only seems to happen when I do the urlencode() testing above, and not until the 3rd or
>> 4th line of input.
This seems to be something weird because of the fact that read code is
rather buggy. I'll commit a patch in a minute - please try it.
--
Stanislav Malyshev, Zend Products Engineer
stas@zend.com http://www.zend.com/ +972-3-6139665 ext.106