Bug #14273 Updated: When I use 'urlencode' in a for loop the mod_php core dumps'
| From: | mfischer@php.net | Date: | Wed, 28 Nov 2001 22:51:47 +0000 |
| Subject: | Bug #14273 Updated: When I use 'urlencode' in a for loop the mod_php core dumps' | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-71966@lists.php.net to get a copy of this message | ||
ID: 14273
Updated by: mfischer
Reported By: FitzpatrickB@metrocall.com
Old Status: Open
Status: Feedback
Bug Type: URL related
Operating System: Linux
PHP Version: 4.0.6
New Comment:
Um ... list($name$url) looks really weird to me. You should write list($name, $url) instead.
Can you reproduce this with latest (not official) release?
http://www.php.net/~zeev/php-4.1.0.tar.gz
Also, the actual content of '$url' would be interesting anyway (since coredump is never
ok), something like 'var_dump($url);' before passing it to urlencode().
Feedback.
Previous Comments:
------------------------------------------------------------------------
[2001-11-28 17:23:08] FitzpatrickB@metrocall.com
This works!!!
$cnt = count($arrayA);
for ( $ix=0 ; $ix < $cnt; $ix++ )
{
$aurl = mysql_query("select name, url from sites where
code='".$arrayA[$ix][1]."'");
list($name$url) = mysql_fetch_row($aurl);
mysql_free_result($aurl);
echo "$url $name";
}
This Fails!!
$cnt = count($arrayA);
for ( $ix=0 ; $ix < $cnt; $ix++ )
{
$aurl = mysql_query("select name, url from sites where
code='".$arrayA[$ix][1]."'");
list($name$url) = mysql_fetch_row($aurl);
mysql_free_result($aurl);
echo urlencode($url)," $name";
}
Only change is addition of urlencode, What gives?
------------------------------------------------------------------------
Edit this bug report at http://bugs.php.net/?id=14273&edit=1