#48141 [Opn->Asn]: memory leak in zend_execute.c and zend_operators.c

2009-05-04 Thread tony2001
 ID:   48141
 Updated by:   tony2...@php.net
 Reported By:  greg at chiaraquartet dot net
-Status:   Open
+Status:   Assigned
 Bug Type: Scripting Engine problem
 Operating System: ubuntu linux
 PHP Version:  5.3CVS-2009-05-04 (CVS)
-Assigned To:  
+Assigned To:  dmitry
 New Comment:

Dmitry, could you look into it?


Previous Comments:


[2009-05-04 04:24:12] greg at chiaraquartet dot net

Description:

When running a simple file that only instantiates objects using
autoload, there is a memory leak.

The leak appears to be caused by some combination of string
concatenation and exception throwing.  The line that causes the leak is
in Pyrus/src/Pyrus/Registry/Sqlite3.php in the constructor:

if ($path && $path != ':memory:') {
if (dirname($path) . DIRECTORY_SEPARATOR . '.pear2registry'
!= $path) {
$path = $path . DIRECTORY_SEPARATOR .
'.pear2registry';
}
}

The line "$path = $path . DIRECTORY_SEPARATOR . '.pear2registry';"

leaks the value "/usr/local/lib/php/.pear2registry" on my machine, and
the zval allocated for $path.

Reproduce code:
---
http://svn.pear.php.net/PEAR2/all
function __autoload($class)
{
if ($class == 'PEAR2_Exception') {
include __DIR__ . '/Exception/src/Exception.php';
return;
}
$class = str_replace('PEAR2_', '', $class);
$class = str_replace('_', '/', $class);
include __DIR__ . '/Pyrus/src/' . $class . '.php';
}
$a = PEAR2_Pyrus_Config::current();


Expected result:

no output

Actual result:
--
u...@ubuntu8041:~/workspace/all/Pyrus/tests/AtomicFileTransaction/rmrf$
php -n test.phpt
[Sun May  3 22:58:31 2009]  Script:  'test.phpt'
/home/user/workspace/php5/Zend/zend_execute.c(723) :  Freeing
0xB7B52AE4 (20 bytes), script=test.phpt
[Sun May  3 22:58:31 2009]  Script:  'test.phpt'
/home/user/workspace/php5/Zend/zend_operators.c(1231) :  Freeing
0x088CE1EC (34 bytes), script=test.phpt
=== Total 2 memory leaks detected ===






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



#47773 [Com]: cURL multi crashes

2009-05-04 Thread daniel at haxx dot se
 ID:   47773
 Comment by:   daniel at haxx dot se
 Reported By:  entpman at gmail dot com
 Status:   Verified
 Bug Type: cURL related
 Operating System: *
 PHP Version:  5.2.9
 Assigned To:  pajoye
 New Comment:

What? "not only windows" makes no sense and offers no help at all.


Previous Comments:


[2009-05-03 21:57:23] paj...@php.net

not only windows



[2009-04-06 20:45:05] daniel at haxx dot se

I'm convinced this is a bug in libcurl, see this analysis by 
Sergii Volchkov:

http://curl.haxx.se/mail/lib-2009-04/0028.html

(AFAIK, there is nobody working on a fix for this.)



[2009-03-25 15:29:52] entpman at gmail dot com

I tried version 5.3.0RC2-dev same results.



[2009-03-25 14:08:06] entpman at gmail dot com

Description:

The program will work fine for hundreds of downloads then suddenly
crashes.

Reproduce code:
---
 'http://www.google.com'
),
array(
'url' => 'http://www.yahoo.com'
)
)
);

// of course more urls are needs

function downloadurls($downloads,$cookie = null){   
$timeout = 30;  
$mcurl = curl_multi_init();
$agent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12)
Gecko/2009201 Firefox/3.0.0.1";

foreach($downloads as $key=>$download){ 
$url = $download['url'];
$ch = curl_init();   
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
if(!empty($download['postdata'])){
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS,$download['postdata']); 
}   
if(!empty($cookie)){
@unlink($cookie);
//echo "added cookie\n";
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
}
if(!empty($download['proxy'])){
curl_setopt($ch, CURLOPT_PROXY, $download['proxy']);
}
curl_multi_add_handle($mcurl, $ch);
$downloads[$key]['handle'] = $ch;   
}

do {
$n=curl_multi_exec($mcurl,$active);
usleep(100);
}   
while ($active);

foreach($downloads as $key=>$download){ 
$ch = $download['handle'];
$done_content = curl_multi_getcontent($ch);
if(curl_errno($ch) == 0) {
$downloads[$key]['picture'] = $done_content;
} else {
exit('error');  
}
curl_multi_remove_handle($mcurl, $ch);
curl_close($ch);   
}

curl_multi_close($mcurl);
return $downloads;
}
?>

Actual result:
--
backtrace:

php_curl.dll!_Curl_llist_insert_next()  + 0x48 bytes
php_curl.dll!_Curl_hash_add()  + 0x74 bytes 
php_curl.dll!_Curl_cache_addr()  + 0x6d bytes   
php_curl.dll!_Curl_addrinfo4_callback()  + 0x82 bytes   
php_curl.dll!_Curl_addrinfo4_callback()  + 0x14 bytes   
php_curl.dll!_Curl_getaddrinfo()  + 0x317 bytes 
msvcrt.dll!77c3a3b0()   
[Frames below may be incorrect and/or missing, no symbols loaded for
msvcrt.dll] 
kernel32.dll!7c80b683() 





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



#47773 [Com]: cURL multi crashes

2009-05-04 Thread daniel at haxx dot se
 ID:   47773
 Comment by:   daniel at haxx dot se
 Reported By:  entpman at gmail dot com
 Status:   Verified
 Bug Type: cURL related
 Operating System: *
 PHP Version:  5.2.9
 Assigned To:  pajoye
 New Comment:

(ehm, sorry if that came out harsh-sounding, it wasn't really my
intension to sound like an angry pitbull)


Previous Comments:


[2009-05-04 08:43:00] daniel at haxx dot se

What? "not only windows" makes no sense and offers no help at all.



[2009-05-03 21:57:23] paj...@php.net

not only windows



[2009-04-06 20:45:05] daniel at haxx dot se

I'm convinced this is a bug in libcurl, see this analysis by 
Sergii Volchkov:

http://curl.haxx.se/mail/lib-2009-04/0028.html

(AFAIK, there is nobody working on a fix for this.)



[2009-03-25 15:29:52] entpman at gmail dot com

I tried version 5.3.0RC2-dev same results.



[2009-03-25 14:08:06] entpman at gmail dot com

Description:

The program will work fine for hundreds of downloads then suddenly
crashes.

Reproduce code:
---
 'http://www.google.com'
),
array(
'url' => 'http://www.yahoo.com'
)
)
);

// of course more urls are needs

function downloadurls($downloads,$cookie = null){   
$timeout = 30;  
$mcurl = curl_multi_init();
$agent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12)
Gecko/2009201 Firefox/3.0.0.1";

foreach($downloads as $key=>$download){ 
$url = $download['url'];
$ch = curl_init();   
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
if(!empty($download['postdata'])){
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS,$download['postdata']); 
}   
if(!empty($cookie)){
@unlink($cookie);
//echo "added cookie\n";
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
}
if(!empty($download['proxy'])){
curl_setopt($ch, CURLOPT_PROXY, $download['proxy']);
}
curl_multi_add_handle($mcurl, $ch);
$downloads[$key]['handle'] = $ch;   
}

do {
$n=curl_multi_exec($mcurl,$active);
usleep(100);
}   
while ($active);

foreach($downloads as $key=>$download){ 
$ch = $download['handle'];
$done_content = curl_multi_getcontent($ch);
if(curl_errno($ch) == 0) {
$downloads[$key]['picture'] = $done_content;
} else {
exit('error');  
}
curl_multi_remove_handle($mcurl, $ch);
curl_close($ch);   
}

curl_multi_close($mcurl);
return $downloads;
}
?>

Actual result:
--
backtrace:

php_curl.dll!_Curl_llist_insert_next()  + 0x48 bytes
php_curl.dll!_Curl_hash_add()  + 0x74 bytes 
php_curl.dll!_Curl_cache_addr()  + 0x6d bytes   
php_curl.dll!_Curl_addrinfo4_callback()  + 0x82 bytes   
php_curl.dll!_Curl_addrinfo4_callback()  + 0x14 bytes   
php_curl.dll!_Curl_getaddrinfo()  + 0x317 bytes 
msvcrt.dll!77c3a3b0()   
[Frames below may be incorrect and/or missing, no symbols loaded for
msvcrt.dll] 
kernel32.dll!7c80b683() 





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



#47773 [Ver]: cURL multi crashes

2009-05-04 Thread pajoye
 ID:   47773
 Updated by:   paj...@php.net
 Reported By:  entpman at gmail dot com
 Status:   Verified
 Bug Type: cURL related
 Operating System: *
 PHP Version:  5.2.9
 Assigned To:  pajoye
 New Comment:

Read the whole diff please, I changed the OS field to mention that this
bug is not windows specific.


Previous Comments:


[2009-05-04 08:44:45] daniel at haxx dot se

(ehm, sorry if that came out harsh-sounding, it wasn't really my
intension to sound like an angry pitbull)



[2009-05-04 08:43:00] daniel at haxx dot se

What? "not only windows" makes no sense and offers no help at all.



[2009-05-03 21:57:23] paj...@php.net

not only windows



[2009-04-06 20:45:05] daniel at haxx dot se

I'm convinced this is a bug in libcurl, see this analysis by 
Sergii Volchkov:

http://curl.haxx.se/mail/lib-2009-04/0028.html

(AFAIK, there is nobody working on a fix for this.)



[2009-03-25 15:29:52] entpman at gmail dot com

I tried version 5.3.0RC2-dev same results.



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/47773

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



#45500 [Opn->Bgs]: CURL Return Progress Callback (Request)

2009-05-04 Thread pajoye
 ID:   45500
 Updated by:   paj...@php.net
 Reported By:  chris at active9 dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: Linux (Fedora)
 PHP Version:  5.2.6
 New Comment:

duplicate #41712 (implemented)


Previous Comments:


[2008-07-13 15:20:41] chris at active9 dot com

Description:

I was wondering if anyone could add the functionality of curl return
progress to the next php build. Someone has already created a patch for
php 5.2.4 and it could easily be added to the next build.

http://sdteffen.de/php/php_curl_progress_callback.patch

There is the location of the php curl return progress callback patch.
Could a developer please! add this to the next release.

Reproduce code:
---
http://sdteffen.de/php/php_curl_progress_callback.patch

Expected result:

Curl will return upload / download information to a callback function.

Actual result:
--
Curl will return upload / download information to a callback function.





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



#48142 [NEW]: Confusing behavior

2009-05-04 Thread smh at wannafind dot dk
From: smh at wannafind dot dk
Operating system: Linux 2.6.24.3-50.fc8
PHP version:  5.2.9
PHP Bug Type: Feature/Change Request
Bug description:  Confusing behavior

Description:

Requesting a string index on a string type using the string as an array
always returns first character position in string.

Reproduce code:
---


Expected result:

PHP should generate an error when this occurs, because this situation
occurs when you think a method/function returns a string indexed array but
really just returns a string.
In this situation you get some data, but the data is incorrect and this
can be very confusing to debug.

Actual result:
--
PHP casts the string index to an integer with the value: 0 and returns the
first character in the string.

-- 
Edit bug report at http://bugs.php.net/?id=48142&edit=1
-- 
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=48142&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=48142&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=48142&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=48142&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=48142&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=48142&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=48142&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=48142&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=48142&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=48142&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=48142&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=48142&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=48142&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=48142&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=48142&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=48142&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=48142&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=48142&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=48142&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=48142&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=48142&r=mysqlcfg



#48135 [Fbk->Opn]: Isset doesn't function as expected

2009-05-04 Thread wizanda at yahoo dot co dot uk
 ID:   48135
 User updated by:  wizanda at yahoo dot co dot uk
 Reported By:  wizanda at yahoo dot co dot uk
-Status:   Feedback
+Status:   Open
 Bug Type: Feature/Change Request
 Operating System: all
 PHP Version:  5.2.9
 New Comment:

Thank you for the reply, here is a better example and a rephrase of the
problem...
';}
var_dump($handlers);
$handle = $handlers[$name];
return $handle;}
collectClass('Funky');
collectClass('Funky');
collectClass('Funky');
?>
On doing this i realized its not so much isset is broken sorry, as if
we test the occurrences of the count, we find it runs once...Yet if we
var_dump() the static var, it has 3 copies of something that it has only
collected once and so shouldn't it only be stored once? Else its
amassing tons of data in a large system?


Previous Comments:


[2009-05-04 00:42:28] scott...@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

We need a self contained script that we can run, though it sounds like
you just need.

!isset($handler, $handler[$name])

To check both the array and the key.



[2009-05-03 12:33:15] wizanda at yahoo dot co dot uk

Description:

Since PHP 5 most PHP systems will be storing masses of data, due to
isset and empty no longer assessing the full variable, yet running code
once for each item within it.

Reproduce code:
---
---
>From manual page: function.isset
---
function &loadHandler($name){static $handler;
if(!isset($handler[$name])){$FileName = "core/core.".$name.".php";
require_once $FileName;
$ClassName = "SmartyCore_".$name;
$handler[$name] = new $ClassName();}
$classes = $handler[$name];
return $classes;}

Expected result:

This should check $handler, see if it's empty the first time; check
$name and see this is an empty array, attempt to fill it and thus
setting the $handler as being a container for the array and then check
for each $name as a separate array within it.


Actual result:
--
What this appears to be doing is checking $handler and running it, then
checking $name and running it... So when you var_dump the $handler it
has multiple copies of the variable set.
This can be slightly resolved by making the array set the original
$handler variable, which reduces the copies made.
$handler = array($name => new $ClassName());}
...Yet there should be only one copy set.





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



#47497 [Ver->Bgs]: CachingIterator doesn't work with an IteratorIterator inside it

2009-05-04 Thread johannes
 ID:   47497
 Updated by:   johan...@php.net
 Reported By:  doctorrock83 at gmail dot com
-Status:   Verified
+Status:   Bogus
 Bug Type: SPL related
 Operating System: *
 PHP Version:  5.*, 6CVS (2009-04-30)
 New Comment:

You have to call $cache->rewind(); first else the iterator in in a not
defined state.


Previous Comments:


[2009-02-24 16:34:31] doctorrock83 at gmail dot com

"Expected result" is 
'a' and TRUE 
and not
1 and TRUE
as you might have guessed



[2009-02-24 16:31:36] doctorrock83 at gmail dot com

Description:

CachingIterator doesn't work if its innerIterator is an instance of
IteratorIterator.

The use-case provided here might seem strange as the IteratorIterator
is not necessary.
However, it would become necessary for a use case dealing with a
Traversable class such as PDOStatement, and the bug stays the same.

Additionnaly, we actually have to call next() manually but it should be
called internaly.
This leads to another bug which has already been reported at #46227

Reproduce code:
---
$it = new ArrayIterator(range('a','z');
$cache = new CachingIterator(new IteratorIterator($it));
$cache->next();
var_dump($cache->current());
var_dump($cache->hasNext());

Expected result:

1 and TRUE

Actual result:
--
NULL and FALSE





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



#48141 [Asn->Fbk]: memory leak in zend_execute.c and zend_operators.c

2009-05-04 Thread dmitry
 ID:   48141
 Updated by:   dmi...@php.net
 Reported By:  greg at chiaraquartet dot net
-Status:   Assigned
+Status:   Feedback
 Bug Type: Scripting Engine problem
 Operating System: ubuntu linux
 PHP Version:  5.3CVS-2009-05-04 (CVS)
 Assigned To:  dmitry
 New Comment:

I'm not able to reproduce it with CVS PHP_5_3.


Previous Comments:


[2009-05-04 08:03:17] tony2...@php.net

Dmitry, could you look into it?



[2009-05-04 04:24:12] greg at chiaraquartet dot net

Description:

When running a simple file that only instantiates objects using
autoload, there is a memory leak.

The leak appears to be caused by some combination of string
concatenation and exception throwing.  The line that causes the leak is
in Pyrus/src/Pyrus/Registry/Sqlite3.php in the constructor:

if ($path && $path != ':memory:') {
if (dirname($path) . DIRECTORY_SEPARATOR . '.pear2registry'
!= $path) {
$path = $path . DIRECTORY_SEPARATOR .
'.pear2registry';
}
}

The line "$path = $path . DIRECTORY_SEPARATOR . '.pear2registry';"

leaks the value "/usr/local/lib/php/.pear2registry" on my machine, and
the zval allocated for $path.

Reproduce code:
---
http://svn.pear.php.net/PEAR2/all
function __autoload($class)
{
if ($class == 'PEAR2_Exception') {
include __DIR__ . '/Exception/src/Exception.php';
return;
}
$class = str_replace('PEAR2_', '', $class);
$class = str_replace('_', '/', $class);
include __DIR__ . '/Pyrus/src/' . $class . '.php';
}
$a = PEAR2_Pyrus_Config::current();


Expected result:

no output

Actual result:
--
u...@ubuntu8041:~/workspace/all/Pyrus/tests/AtomicFileTransaction/rmrf$
php -n test.phpt
[Sun May  3 22:58:31 2009]  Script:  'test.phpt'
/home/user/workspace/php5/Zend/zend_execute.c(723) :  Freeing
0xB7B52AE4 (20 bytes), script=test.phpt
[Sun May  3 22:58:31 2009]  Script:  'test.phpt'
/home/user/workspace/php5/Zend/zend_operators.c(1231) :  Freeing
0x088CE1EC (34 bytes), script=test.phpt
=== Total 2 memory leaks detected ===






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



#44383 [Com]: PHP DateTime not converted to xsd:datetime

2009-05-04 Thread bme at hst dot aau dot dk
 ID:   44383
 Comment by:   bme at hst dot aau dot dk
 Reported By:  kevin dot craft at gmail dot com
 Status:   Feedback
 Bug Type: SOAP related
 Operating System: Windows XP
 PHP Version:  5.2.6
 New Comment:

I tried the snapshot on windows xp, apache 2.2, with the php code
supplied in this thread and this is what I see:

Request:


   
   
  
   


Response:


   
  
 
  
   


Assuming the supplied wsdl and php server/client is correct, DateTime
is still not being served correctly. I am not even seeing xsd:datetime
in the response.

Allt "http" have been changed to "hxxp" to be able to post the comment.


Previous Comments:


[2009-04-28 18:37:21] j...@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/





[2008-12-10 13:44:17] martijn dot zijlstra at gmail dot com

still not fixed in 5.2.6-0.dotdeb.1



[2008-06-30 12:00:56] r dot janssen at keensystems dot eu

I am, too, looking for a solution for this problem.
I can specify parameters as dateTime type but when generating the WSDL
the generation stops and does nothing.



[2008-05-13 04:40:11] barth at pbx-network dot de

Anyone has a soluiton or workaround for this issue?  How can a
date/time been passed over to a webservice endpoint?



[2008-03-17 01:17:47] kevin dot craft at gmail dot com

Exactly. The SOAP extension should know what format to output the
DateTime as because it should be specified as a W3C standard somewhere
in the SOAP or XML Schema definition. When the SOAP extension encounters
an xsd:datetime (or related type), it should output the DateTime object
according to the standard for that type.



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/44383

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



#48135 [Opn]: Isset doesn't function as expected

2009-05-04 Thread wizanda at yahoo dot co dot uk
 ID:   48135
 User updated by:  wizanda at yahoo dot co dot uk
 Reported By:  wizanda at yahoo dot co dot uk
 Status:   Open
 Bug Type: Feature/Change Request
 Operating System: all
 PHP Version:  5.2.9
 New Comment:

Found that if you return it first when it's set, it won't multiple fill
the static var, yet this is also the same as a singleton pattern, so it
looks as if those are also mass storing information.
';}
var_dump($handlers);
$handle = $handlers[$name];
return $handle;}
collectClass('Funky');
collectClass('Funky');
collectClass('Funky');
?>


Previous Comments:


[2009-05-04 09:45:34] wizanda at yahoo dot co dot uk

Thank you for the reply, here is a better example and a rephrase of the
problem...
';}
var_dump($handlers);
$handle = $handlers[$name];
return $handle;}
collectClass('Funky');
collectClass('Funky');
collectClass('Funky');
?>
On doing this i realized its not so much isset is broken sorry, as if
we test the occurrences of the count, we find it runs once...Yet if we
var_dump() the static var, it has 3 copies of something that it has only
collected once and so shouldn't it only be stored once? Else its
amassing tons of data in a large system?



[2009-05-04 00:42:28] scott...@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

We need a self contained script that we can run, though it sounds like
you just need.

!isset($handler, $handler[$name])

To check both the array and the key.



[2009-05-03 12:33:15] wizanda at yahoo dot co dot uk

Description:

Since PHP 5 most PHP systems will be storing masses of data, due to
isset and empty no longer assessing the full variable, yet running code
once for each item within it.

Reproduce code:
---
---
>From manual page: function.isset
---
function &loadHandler($name){static $handler;
if(!isset($handler[$name])){$FileName = "core/core.".$name.".php";
require_once $FileName;
$ClassName = "SmartyCore_".$name;
$handler[$name] = new $ClassName();}
$classes = $handler[$name];
return $classes;}

Expected result:

This should check $handler, see if it's empty the first time; check
$name and see this is an empty array, attempt to fill it and thus
setting the $handler as being a container for the array and then check
for each $name as a separate array within it.


Actual result:
--
What this appears to be doing is checking $handler and running it, then
checking $name and running it... So when you var_dump the $handler it
has multiple copies of the variable set.
This can be slightly resolved by making the array set the original
$handler variable, which reduces the copies made.
$handler = array($name => new $ClassName());}
...Yet there should be only one copy set.





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



#48142 [Opn->Bgs]: Confusing behavior

2009-05-04 Thread scottmac
 ID:   48142
 Updated by:   scott...@php.net
 Reported By:  smh at wannafind dot dk
-Status:   Open
+Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: Linux 2.6.24.3-50.fc8
 PHP Version:  5.2.9
 New Comment:

Adding new errors would result in breaking backwards compatibility so
it isn't really practical to change.

You could add an array typehint to parameters to add extra checking.


Previous Comments:


[2009-05-04 09:46:44] smh at wannafind dot dk

Description:

Requesting a string index on a string type using the string as an array
always returns first character position in string.

Reproduce code:
---


Expected result:

PHP should generate an error when this occurs, because this situation
occurs when you think a method/function returns a string indexed array
but really just returns a string.
In this situation you get some data, but the data is incorrect and this
can be very confusing to debug.

Actual result:
--
PHP casts the string index to an integer with the value: 0 and returns
the first character in the string.





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



#48135 [Opn->Bgs]: Isset doesn't function as expected

2009-05-04 Thread scottmac
 ID:   48135
 Updated by:   scott...@php.net
 Reported By:  wizanda at yahoo dot co dot uk
-Status:   Open
+Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: all
 PHP Version:  5.2.9
 New Comment:

I can't reproduce this, the output I get is as follows:

scott-mbp:tmp scott$ /usr/bin/php test.php
countarray(1) {
  ["Funky"]=>
  object(Funky)#1 (0) {
  }
}



Previous Comments:


[2009-05-04 11:12:27] wizanda at yahoo dot co dot uk

Found that if you return it first when it's set, it won't multiple fill
the static var, yet this is also the same as a singleton pattern, so it
looks as if those are also mass storing information.
';}
var_dump($handlers);
$handle = $handlers[$name];
return $handle;}
collectClass('Funky');
collectClass('Funky');
collectClass('Funky');
?>



[2009-05-04 09:45:34] wizanda at yahoo dot co dot uk

Thank you for the reply, here is a better example and a rephrase of the
problem...
';}
var_dump($handlers);
$handle = $handlers[$name];
return $handle;}
collectClass('Funky');
collectClass('Funky');
collectClass('Funky');
?>
On doing this i realized its not so much isset is broken sorry, as if
we test the occurrences of the count, we find it runs once...Yet if we
var_dump() the static var, it has 3 copies of something that it has only
collected once and so shouldn't it only be stored once? Else its
amassing tons of data in a large system?



[2009-05-04 00:42:28] scott...@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

We need a self contained script that we can run, though it sounds like
you just need.

!isset($handler, $handler[$name])

To check both the array and the key.



[2009-05-03 12:33:15] wizanda at yahoo dot co dot uk

Description:

Since PHP 5 most PHP systems will be storing masses of data, due to
isset and empty no longer assessing the full variable, yet running code
once for each item within it.

Reproduce code:
---
---
>From manual page: function.isset
---
function &loadHandler($name){static $handler;
if(!isset($handler[$name])){$FileName = "core/core.".$name.".php";
require_once $FileName;
$ClassName = "SmartyCore_".$name;
$handler[$name] = new $ClassName();}
$classes = $handler[$name];
return $classes;}

Expected result:

This should check $handler, see if it's empty the first time; check
$name and see this is an empty array, attempt to fill it and thus
setting the $handler as being a container for the array and then check
for each $name as a separate array within it.


Actual result:
--
What this appears to be doing is checking $handler and running it, then
checking $name and running it... So when you var_dump the $handler it
has multiple copies of the variable set.
This can be slightly resolved by making the array set the original
$handler variable, which reduces the copies made.
$handler = array($name => new $ClassName());}
...Yet there should be only one copy set.





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



#23815 [Com]: imagecopymerge doesn't respect alpha-channel in PNG-24 file

2009-05-04 Thread checat at yandex dot ru
 ID:   23815
 Comment by:   checat at yandex dot ru
 Reported By:  bjorn at smokingmedia dot com
 Status:   No Feedback
 Bug Type: GD related
 Operating System: Linux pluto 2.4.18lvm-r1
 PHP Version:  4.3.1
 Assigned To:  pajoye
 New Comment:

Please try again: site with images is up and running.

I've also uploaded files to alternate location, get them from
http://checat.narod.ru/php-bug-23815/


Previous Comments:


[2009-05-01 01:00:02] 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".



[2009-04-23 18:08:41] paj...@php.net

Site not accessible (timeout)



[2009-04-23 17:52:32] checat at yandex dot ru

PHP version: 5.2.9
CentOS 4

Reproduce code:
http://guppi.spb.ru/php-bug-23815/bg.png');
$over =
imagecreatefrompng('http://guppi.spb.ru/php-bug-23815/over.png');
imagecopymerge($bg, $over, 0,0,0,0,32,32,100);
imagecopymerge($bg, $over, 16,0,0,0,32,32,50);
imagepng($bg, 'imagecopymerge.png');
?>

Expected result:
Proper image: 
http://guppi.spb.ru/php-bug-23815/proper.png

Actual result:
Wrong image:
http://guppi.spb.ru/php-bug-23815/imagecopymerge.png



[2003-06-02 17:27:30] sni...@php.net

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.





[2003-05-26 11:50:26] der...@php.net

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



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/23815

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



#47739 [Opn->Csd]: Missing cURL option do disable IPv6

2009-05-04 Thread pajoye
 ID:   47739
 Updated by:   paj...@php.net
 Reported By:  gem at rellim dot com
-Status:   Open
+Status:   Closed
 Bug Type: Feature/Change Request
 Operating System: Linux
 PHP Version:  5.2.9
-Assigned To:  
+Assigned To:  pajoye
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Added to 5.3+


Previous Comments:


[2009-03-20 23:05:24] gem at rellim dot com

Description:

I am working with a remote web server, not under my control, that has
broken IPv6 support.  So I need to make a cURL connection and force an
IPv4 connection.  The CLI 'curl' has the '-4' option.  The C API has
the CURL_IPRESOLVE_V4  option.  But I can not see how to force this
option using the PHP cURL API.

In a perfect world this would not be required, but I need IPv6 for
other things so I can not just diable IPv6 in my PHP.  I can not fix the
remote server.  So I need the CURL_IPRESOLVE_V4 option.

Somewhat related to bugs #39637 and #39933






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



#48136 [Opn->Bgs]: Empty session id causes a warning

2009-05-04 Thread iliaa
 ID:   48136
 Updated by:   il...@php.net
 Reported By:  dont dot want at spam dot no
-Status:   Open
+Status:   Bogus
 Bug Type: Session related
 Operating System: Win XP SP2
 PHP Version:  5.2.9
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.


Previous Comments:


[2009-05-03 14:26:14] dont dot want at spam dot no

Description:

If session cookie is an empty string, PHP gives the following warning:
"Warning:  session_start() [function.session-start]: The session id
contains illegal characters, valid characters are a-z, A-Z, 0-9 and
'-,'".

Worst case scenario: If the user sets the session id to an empty string
manually in their browser and php errors are displayed, the page will
break (could not start session, headers already sent by warning message,
etc.).

Normal scenario: display_errors is disabled, so this will only clutter
the error log with an unnecessary warning.

In my case I have session.use_only_cookies enabled and I work around
the issue with the following code:


Reproduce code:
---
I used jQuery with a cookie addon to set the cookie to an empty string
(was actually trying to delete the cookie), but the same could be
simulated with the following 2 lines of PHP:



You also get the same using GET (eg. "localhost/index.php?PHPSESSID=",
remember to delete any old cookies before trying this or it won't work)




Expected result:

No warning since session ID is empty and PHP should be smart enough to
realise that this means that the session id has not been generated yet.

Actual result:
--
Warning: session_start() [function.session-start]: The session id
contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,'
in F:\htdocs\index.php on line 9





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



#28038 [Com]: Sent incorrect RCPT TO commands to SMTP server

2009-05-04 Thread php at shitware dot nl
 ID:   28038
 Comment by:   php at shitware dot nl
 Reported By:  jordi at jcanals dot net
 Status:   Open
 Bug Type: Mail related
 Operating System: win32 only
 PHP Version:  5CVS, 6CVS (2008-10-24)
 New Comment:

Go ahead (the address DOES exist)


Previous Comments:


[2009-04-16 12:54:47] jitendra1212 at gmail dot com

send how mail ?



[2009-04-06 14:29:44] php at shitware dot nl

I'm no C expert, but wouldn't this provide a quick fix:

instead of:

snprintf(Buffer, MAIL_BUFFER_SIZE, "RCPT TO:<%s>\r\n", token);

use:

snprintf(Buffer, MAIL_BUFFER_SIZE, token[(strlen(token)-1)] == ">" ?
"RCPT TO:%s\r\n" : "RCPT TO:<%s>\r\n", token);

for EVERY use of token (including RPath)?

(plain e-mail addresses are still placed between <...>, formatted
e-mail addresses get in the transaction unaltered)

I tried setting up the Windows build environment to test this, but got
lost in the different how-to's ...



[2009-03-12 19:49:06] feamsr00 at feamsternet dot net

exact same here *bump*
PHP 5.2.8 (cli) (built: Feb  4 2009 17:55:55)
Microsoft Windows XP [Version 5.1.2600]



[2009-02-24 23:25:22] mark at lbisat dot com

By modifying the following in PHP.ini

[mail function]
sendmail_from = em...@domain.com

It fixed the issue for me on Windows 2003 Server SP2.



[2009-02-19 19:39:06] alexcomboy at hotmail dot co dot uk

It does not work with this either:
Windows XP SP2 or SP3, IIS 5.1, PHP 5.2.8



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/28038

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



#39933 [Opn->Bgs]: Curl extension is missing CURLOPT_TCP_NODELAY

2009-05-04 Thread pajoye
 ID:   39933
 Updated by:   paj...@php.net
 Reported By:  gop...@php.net
-Status:   Open
+Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: linux-i686
 PHP Version:  5CVS-2006-12-22 (CVS)
 New Comment:

added already.


Previous Comments:


[2006-12-22 19:39:07] gop...@php.net

For a more decent test case 

http://phpfi.com/187148

$curlopts is derieved from the enum CURLOption in curl/curl.h



[2006-12-22 19:36:16] gop...@php.net

Description:

ext/curl is missing the constant CURLOPT_TCP_NODELAY (121)

Reproduce code:
---
http://localhost');
 curl_setopt($ch, CURLOPT_TCP_NODELAY, 1);
?>


Expected result:

the curl tcpnodelay() function is called and socket optiosn set.

Actual result:
--
PHP Notice:  Use of undefined constant CURLOPT_TCP_NODELAY





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



#23815 [NoF->Asn]: imagecopymerge doesn't respect alpha-channel in PNG-24 file

2009-05-04 Thread pajoye
 ID:   23815
 Updated by:   paj...@php.net
 Reported By:  bjorn at smokingmedia dot com
-Status:   No Feedback
+Status:   Assigned
 Bug Type: GD related
 Operating System: Linux pluto 2.4.18lvm-r1
 PHP Version:  4.3.1
 Assigned To:  pajoye


Previous Comments:


[2009-05-04 12:14:15] checat at yandex dot ru

Please try again: site with images is up and running.

I've also uploaded files to alternate location, get them from
http://checat.narod.ru/php-bug-23815/



[2009-05-01 01:00:02] 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".



[2009-04-23 18:08:41] paj...@php.net

Site not accessible (timeout)



[2009-04-23 17:52:32] checat at yandex dot ru

PHP version: 5.2.9
CentOS 4

Reproduce code:
http://guppi.spb.ru/php-bug-23815/bg.png');
$over =
imagecreatefrompng('http://guppi.spb.ru/php-bug-23815/over.png');
imagecopymerge($bg, $over, 0,0,0,0,32,32,100);
imagecopymerge($bg, $over, 16,0,0,0,32,32,50);
imagepng($bg, 'imagecopymerge.png');
?>

Expected result:
Proper image: 
http://guppi.spb.ru/php-bug-23815/proper.png

Actual result:
Wrong image:
http://guppi.spb.ru/php-bug-23815/imagecopymerge.png



[2003-06-02 17:27:30] sni...@php.net

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.





The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/23815

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



#48135 [Bgs]: Isset doesn't function as expected

2009-05-04 Thread wizanda at yahoo dot co dot uk
 ID:   48135
 User updated by:  wizanda at yahoo dot co dot uk
 Reported By:  wizanda at yahoo dot co dot uk
 Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: all
 PHP Version:  5.2.9
 New Comment:

There are two scripts there...
The first has shown multiple copies on a fresh install of WAMP, and on
my webserver.
This same principle is similar to a singleton pattern and can be also
tested in these. Even on a single variable with no array, if multiple
copies of a class instance are called; When we var_dump() the static
variable, it has multiples of the class object, and thus its not
single
To make it single, as a solution to the static variables holding to
much data, the second script shows that if it's set we return it;
Thus only allowing the one copy of the class object, within the static
variable.


Previous Comments:


[2009-05-04 11:28:06] scott...@php.net

I can't reproduce this, the output I get is as follows:

scott-mbp:tmp scott$ /usr/bin/php test.php
countarray(1) {
  ["Funky"]=>
  object(Funky)#1 (0) {
  }
}




[2009-05-04 11:12:27] wizanda at yahoo dot co dot uk

Found that if you return it first when it's set, it won't multiple fill
the static var, yet this is also the same as a singleton pattern, so it
looks as if those are also mass storing information.
';}
var_dump($handlers);
$handle = $handlers[$name];
return $handle;}
collectClass('Funky');
collectClass('Funky');
collectClass('Funky');
?>



[2009-05-04 09:45:34] wizanda at yahoo dot co dot uk

Thank you for the reply, here is a better example and a rephrase of the
problem...
';}
var_dump($handlers);
$handle = $handlers[$name];
return $handle;}
collectClass('Funky');
collectClass('Funky');
collectClass('Funky');
?>
On doing this i realized its not so much isset is broken sorry, as if
we test the occurrences of the count, we find it runs once...Yet if we
var_dump() the static var, it has 3 copies of something that it has only
collected once and so shouldn't it only be stored once? Else its
amassing tons of data in a large system?



[2009-05-04 00:42:28] scott...@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.

We need a self contained script that we can run, though it sounds like
you just need.

!isset($handler, $handler[$name])

To check both the array and the key.



[2009-05-03 12:33:15] wizanda at yahoo dot co dot uk

Description:

Since PHP 5 most PHP systems will be storing masses of data, due to
isset and empty no longer assessing the full variable, yet running code
once for each item within it.

Reproduce code:
---
---
>From manual page: function.isset
---
function &loadHandler($name){static $handler;
if(!isset($handler[$name])){$FileName = "core/core.".$name.".php";
require_once $FileName;
$ClassName = "SmartyCore_".$name;
$handler[$name] = new $ClassName();}
$classes = $handler[$name];
return $classes;}

Expected result:

This should check $handler, see if it's empty the first time; check
$name and see this is an empty array, attempt to fill it and thus
setting the $handler as being a container for the array and then check
for each $name as a separate array within it.


Actual result:
--
What this appears to be doing is checking $handler and running it, then
checking $name and running it... So when you var_dump the $handler it
has multiple copies of the variable set.
This can be slightly resolved by making the array set the original
$handler variable, which reduces the copies made.
$handler = array($name => new $ClassName());}
...Yet there should be only one copy set.





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



#48131 [Opn->Asn]: stream_context_create / bindto not working with IPv4 on a dual IPv4/IPv6 system

2009-05-04 Thread iliaa
 ID:   48131
 Updated by:   il...@php.net
 Reported By:  dvasseur at diway dot net
-Status:   Open
+Status:   Assigned
 Bug Type: Streams related
 Operating System: Linux - Ubuntu 8.10
 PHP Version:  5.*, 6CVS (2009-05-02)
-Assigned To:  
+Assigned To:  iliaa


Previous Comments:


[2009-05-02 19:30:50] dvasseur at diway dot net

Same bug with CVS snapshot
--
PHP 5.2.10-dev (cli) (built: May  2 2009 21:22:25) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
--



[2009-05-02 13:30:45] dvasseur at diway dot net

Description:

My system has 2 ip addresses, one ipv4 (A.B.C.D) and the other ipv6
(1:2:3:4:5:6)

I'm trying to open a file over HTTP (http://other.server/my.file.dat),
'other.server' is resolving both on ipv4 and ipv6 too.

I'd like to choose wether IPv4 or IPv6 to open the file so I'm using
stream_context_create() with the 'bindto' option.

'bindto' with an ipv4 address is NOT working
'bindto' with an ipv6 address is working


Reproduce code:
---
The following code is working (ipv6 is used)
--
$opts = array(
  'socket' => array(
  'bindto' => '[1:2:3:4:5:6]:0',
  ),
);

$context = stream_context_create($opts);

$contents = file_get_contents('http://other.server/my.file.dat', FALSE,
$context);
--

The following code is NOT working:
--
$opts = array(
  'socket' => array(
  'bindto' => 'A.B.C.D:0',
  ),
);

$context = stream_context_create($opts);

$contents = file_get_contents('http://other.server/my.file.dat', FALSE,
$context);
--

=> PHP Warning:  file_get_contents(): Invalid IP Address: A.B.C.D 

Expected result:

ipv4 working

Actual result:
--
ipv4 NOT working





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



#18833 [Com]: exec() : After throusands calls, causes "Unable to fork" error

2009-05-04 Thread scherbakov_koksa at mail dot ru
 ID:   18833
 Comment by:   scherbakov_koksa at mail dot ru
 Reported By:  antoine dot bajolet at tdf dot fr
 Status:   No Feedback
 Bug Type: *General Issues
 Operating System: GNU/Linux 2.4.9 RH 7.1
 PHP Version:  4.2.1
 New Comment:

It seems I've finally figured out the reason (after a huge amount of
googling UNIX forums).

The PHP fork() error is accompanied by the following entries in Apache
error_log:

[Mon May 04 20:55:59 2009] [alert] (11)Resource temporarily
unavailable: setuid: unable to change to uid: 48
[Mon May 04 20:55:59 2009] [alert] Child 10053 returned a Fatal
error... Apache is exiting!

The system configuration doesn't allow Apache to execute more than N
child processes simultaneously. Apache runs out of this limit and can't
start any more processes. Hence is the error.

The per-user process number limit is set in /etc/security/limits.conf.
In my case, it was enough to raise it and reboot.


Previous Comments:


[2009-03-09 13:33:36] steveg at bscopes dot com

1. did you ever figure out what caused this problem?
2. do you know which apache/php parameters to adjust ?



[2009-02-05 11:37:09] scherbakov_koksa at mail dot ru

I'm having the same issue with PHP 5.2.8, Apache 2.2.11, GNU/Linux
(2.6.20-1.2320.fc5). A php script periodically (per user request)
executes the following command:

xsltproc  

In some time the script starts throwing the "unable to fork" warning.
It is fixed by Apache restart.



[2008-06-01 16:48:39] pahan at hubbitus dot spb dot su

Have same trouble in PHP snapshot 200805080630:

PHP Warning:  exec(): Unable to fork [echo -ne '2008-06-01 05:15:27:
Login: Unable to login (User: hel...@simpla
y.ru)! reason:not connected! (CMD:LOGIN)
 sleep 50 seconds

' >> /home/pasha/temp/php-IMAP/logs/log_ERR 2>&1] in
/var/www/_SHARED_/Debug/HuLOG.php on line 115
PHP Stack trace:
PHP   1. {main}() /home/pasha/temp/php-IMAP/IMAP_answer.php:0
PHP   2. IMAP_mailbox_change_answer()
/home/pasha/temp/php-IMAP/IMAP_answer.php:201
PHP   3. HuLOG->toLog() /home/pasha/temp/php-IMAP/IMAP_answer.php:67
PHP   4. HuLOG->writeLogs() /var/www/_SHARED_/Debug/HuLOG.php:158
PHP   5. HuLOG->log_to_file() /var/www/_SHARED_/Debug/HuLOG.php:162
PHP   6. exec() /var/www/_SHARED_/Debug/HuLOG.php:115

Warning: exec(): Unable to fork [echo -ne '2008-06-01 05:15:27: Login:
Unable to login (User: hel...@simplay.ru)
! reason:not connected! (CMD:LOGIN)
 sleep 50 seconds

' >> /home/pasha/temp/php-IMAP/logs/log_ERR 2>&1] in
/var/www/_SHARED_/Debug/HuLOG.php on line 115

Call Stack:
0.0019 375364   1. {main}()
/home/pasha/temp/php-IMAP/IMAP_answer.php:0
184145.8861   16442044   2. IMAP_mailbox_change_answer()
/home/pasha/temp/php-IMAP/IMAP_answer.php:201
184145.8903   16451552   3. HuLOG->toLog()
/home/pasha/temp/php-IMAP/IMAP_answer.php:67
184145.8908   16451648   4. HuLOG->writeLogs()
/var/www/_SHARED_/Debug/HuLOG.php:158
184145.8908   16451648   5. HuLOG->log_to_file()
/var/www/_SHARED_/Debug/HuLOG.php:162
184145.8917   16451824   6. exec()
/var/www/_SHARED_/Debug/HuLOG.php:115



[2007-12-05 05:22:57] jinglerobs at yahoo dot com

Im using PHP 5.2.4 (cli), Apache & Mysql combination on a Slackware
box.

While running a script that processes large XML files and writes the
log to a log file, I get
Warning: exec(): Unable to fork

Initially the script runs fine for some 3 or 4 hours after which it
gives out the warnings. The script has a huge amount of data to process.
I also tried to use the nohup command but was of no use.
A screenshot of the problem is given below:

DEBUG:INSERT into package
(id,vendor,title,version,ver_major,ver_minor,ver_sub,ver_ext,type)
values ('13001','Microsoft','Windows XP
Home','0.0.0SP1','0','0','0','SP1','Software')

Warning: exec(): Unable to fork [/usr/bin/bash -c "exec nohup setsid
echo \"DEBUG: INSERT into package
(id,vendor,title,version,ver_major,ver_minor,ver_sub,ver_ext,type)
values ('13001','Microsoft','Windows XP
Home','0.0.0SP1','0','0','0','SP1','Software') \">>feed2vendorDB.log
2>&1 &"] in
/usr/local/apache2/htdocs/xml_feed/sircc_agnostic/feed2vendorDB/feed2vendorDB.php
on line 1454
DEBUG:INSERT into package
(id,vendor,title,version,ver_major,ver_minor,ver_sub,ver_ext,type)
values ('13002','Microsoft','Windows XP
Professional','0.0.0SP1','0','0','0','SP1','Software')

Warning: exec(): Unable to fork [/usr/bin/bash -c "exec nohup setsid
echo \"DEBUG: INSERT into package
(id,vendor,title,version,ver_major,ver_minor,ver_sub,ver_ext,type)
values ('13002','Microsoft','Windows XP
Professional','0.0.0SP1','0','0','0','SP1','Software')
\">>feed2vendorDB.log 2>&1 &"] in
/usr/local/apache2/htdocs/xml_feed/sircc_agnostic/feed2vendorDB/

#48131 [Asn->Csd]: stream_context_create / bindto not working with IPv4 on a dual IPv4/IPv6 system

2009-05-04 Thread iliaa
 ID:   48131
 Updated by:   il...@php.net
 Reported By:  dvasseur at diway dot net
-Status:   Assigned
+Status:   Closed
 Bug Type: Streams related
 Operating System: Linux - Ubuntu 8.10
 PHP Version:  5.*, 6CVS (2009-05-02)
 Assigned To:  iliaa
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:


[2009-05-02 19:30:50] dvasseur at diway dot net

Same bug with CVS snapshot
--
PHP 5.2.10-dev (cli) (built: May  2 2009 21:22:25) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
--



[2009-05-02 13:30:45] dvasseur at diway dot net

Description:

My system has 2 ip addresses, one ipv4 (A.B.C.D) and the other ipv6
(1:2:3:4:5:6)

I'm trying to open a file over HTTP (http://other.server/my.file.dat),
'other.server' is resolving both on ipv4 and ipv6 too.

I'd like to choose wether IPv4 or IPv6 to open the file so I'm using
stream_context_create() with the 'bindto' option.

'bindto' with an ipv4 address is NOT working
'bindto' with an ipv6 address is working


Reproduce code:
---
The following code is working (ipv6 is used)
--
$opts = array(
  'socket' => array(
  'bindto' => '[1:2:3:4:5:6]:0',
  ),
);

$context = stream_context_create($opts);

$contents = file_get_contents('http://other.server/my.file.dat', FALSE,
$context);
--

The following code is NOT working:
--
$opts = array(
  'socket' => array(
  'bindto' => 'A.B.C.D:0',
  ),
);

$context = stream_context_create($opts);

$contents = file_get_contents('http://other.server/my.file.dat', FALSE,
$context);
--

=> PHP Warning:  file_get_contents(): Invalid IP Address: A.B.C.D 

Expected result:

ipv4 working

Actual result:
--
ipv4 NOT working





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



#31592 [Opn->Bgs]: ext/informix: ifx_getsqlca fails when DB-error occurs

2009-05-04 Thread pajoye
 ID:   31592
 Updated by:   paj...@php.net
 Reported By:  andreybl at matrix dot co dot il
-Status:   Open
+Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: RedHat 3.0 ES
 PHP Version:  5.0.4, 4.3.11
 New Comment:

Report IFX request via pecl.


Previous Comments:


[2005-09-05 09:02:20] sni...@php.net

Reclassified as feature/change request. But I don't think anyone is
gonna implement this feature unless paid to do so.




[2005-09-05 00:11:06] andreybl at matrix dot co dot il

Ok, ok :)
Just let's take it easy. I do RTFM. I also realise that I am among a
minority of Informix users and this bug(?) is not of the higher
importance :)
But please read my comment(pardon my english). I did NOT say, that
ifx_query() returning FALSE is a bug. Never.
What I say is just that there should be an option to call
ifx_getsqlca() function without a parameter, meaning: "get the sqlca of
the last sql statement performed".
As we all understand I can not insist to fix this. If not, just tell
me, that it is impossible to fix the bug.



[2005-09-04 23:48:02] sni...@php.net

RTFM:
"Returns a positive Informix result identifier on success, or FALSE on
error."

And even if you think this is wrong, we won't change it.




[2005-08-31 15:09:52] andreybl at matrix dot co dot il

I am just wondering what feedback it is supposed to get from me while
it is obvious, that nothing was changed :)
The problem is the interface to the ifx_getsqlca() function: it is
expected that a function receives result_id as a parameter. Here is the
function prototype:
array ifx_getsqlca ( int result_id)
When function  ifx_query() or ifx_prepare() fails, the result_id it
relurns is FALSE FALSE FALSE !!
And thus this FALSE is qualifid as the "not a valid Informix Result
resource" by ifx_getsqlca() function.

We must understand, that there is one global variable of type sqlca
structure(actually one per thread) which has the information about the
LAST SQL statement. So there should be an option to call the
ifx_getsqlca() function without parameter(or may be null/false value for
result_id) meaning that I want the sqlca of the LAST sql statement
performed.

So, please, if there is a possibility to fix this bug do NOT just send
me email in hope that I will not answer :)



[2005-08-30 13:11:55] sni...@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip





The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/31592

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



#47871 [Opn]: PHPIniScanDir directive for apache allows scanning for extension ini files

2009-05-04 Thread pajoye
 ID:   47871
 Updated by:   paj...@php.net
 Reported By:  sriram dot natarajan at gmail dot com
 Status:   Open
 Bug Type: Feature/Change Request
 Operating System: unix and linux
 PHP Version:  5.3.0RC1
 Assigned To:  dsp
 New Comment:

David, what's the status about this one? Should it not be for all SAPI
instead?


Previous Comments:


[2009-04-29 00:01:04] d...@php.net

I think that's a good one. I assign it to me so that we don't forget
about that one.



[2009-04-02 02:47:47] sriram dot natarajan at gmail dot com

hi
 here is the patch to address this issue
http://cr.opensolaris.org/~sn123202/php53-47871.patch
http://cr.opensolaris.org/~sn123202/php52-47871.patch

let me know with your comments..



[2009-04-02 02:28:41] sriram dot natarajan at gmail dot com

Description:

Provide PHPIniScanDir directive similar to PHPIniDir for apache. this
directive can perform the functionality of PHP_INI_SCAN_DIR environment
variable. 

for more information on what PHP_INI_SCAN_DIR, please refer to bug
http://bugs.php.net/bug.php?id=45114

Expected result:

PHPIniScanDir directive should be accepted and php should load
extension specific ini files from this location






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



#47857 [Opn->Bgs]: Deprecated set_magic_quotes_runtime

2009-05-04 Thread pajoye
 ID:  47857
 Updated by:  paj...@php.net
 Reported By: david at grudl dot com
-Status:  Open
+Status:  Bogus
 Bug Type:Feature/Change Request
 PHP Version: 5.3CVS-2009-04-01 (CVS)
 New Comment:

It is done at the function declaration level (if I can say so :).


Previous Comments:


[2009-04-01 06:19:01] david at grudl dot com

Description:

In PHP 5.3 this code throws E_DEPRECATED warning:

   set_magic_quotes_runtime(FALSE);

I think if is directive magic_quotes_runtime (finally!) marked as
deprecated, a code used to disable it should not throws warning.
E_DEPRECATED should throws only this code:

   set_magic_quotes_runtime(TRUE);

Or is there any way to disable magic_quotes_runtime without any
warning?






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



#46490 [Opn->Csd]: php.ini-recommended&php.ini-dist has wrong value for extension_dir

2009-05-04 Thread pajoye
 ID:   46490
 Updated by:   paj...@php.net
 Reported By:  louis at steelbytes dot com
-Status:   Open
+Status:   Closed
 Bug Type: Feature/Change Request
 Operating System: windows
 PHP Version:  5.2.6
-Assigned To:  
+Assigned To:  pajoye
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:


[2008-11-05 02:04:49] louis at steelbytes dot com

Description:

shouldn't the extension_dir ini value in
php.ini-recommended&php.ini-dist match the zip contents?

in 5.2.6 php.ini-recommended&php.ini-dist have
  extension_dir = "./"
but i think it should be
  extension_dir = "ext"

Reproduce code:
---
try unzipping and using the recommend .ini without changes

Expected result:

n/a

Actual result:
--
n/a





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



#46377 [Opn->Bgs]: Problem loading oci.dll with multiple Oracle clients.

2009-05-04 Thread pajoye
 ID:   46377
 Updated by:   paj...@php.net
 Reported By:  phsanghvi at gmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: Windows XP
 PHP Version:  5.2.6
 New Comment:

Set your PATH correctly and it will find it. We can't control what will
happen before we get the hand.


Previous Comments:


[2008-10-24 11:12:38] phsanghvi at gmail dot com

Description:

While working on a machine having multiple Oracle clients installed,
'php_oci8.dll' extension looks for 'oci.dll' file in the first oracle
directory in %path%.

If the first Oracle in %path% is of version 9 or less, extension is
enabled, but it does not work.

IMO, 'php_oci8.dll' should be modified to read the location of
'oci.dll' from 'php.ini' file, where user should set it.

This will help in using multiple Oracle clients and multiple
applications togather.






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



#46361 [Opn->Bgs]: ncurses corrupts non ascii character

2009-05-04 Thread pajoye
 ID:   46361
 Updated by:   paj...@php.net
 Reported By:  s dot le_ray+phpbugs at eutech-ssii dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: Linux
 PHP Version:  5.2.6
 New Comment:

Please report bugs and feature requests in PECL.


Previous Comments:


[2008-10-22 08:36:43] s dot le_ray+phpbugs at eutech-ssii dot com

Description:

When using any text output function (ncurses_addstr, ncurses_mvwaddstr)
with non ascii chars (é, œ, è, etc.) it fails and output string like
"M-CM-)"?.

Reproduce code:
---
http://bugs.php.net/?id=46361&edit=1



#46237 [Opn->Csd]: Repeated compiler warnings (ZE + PHP)

2009-05-04 Thread pajoye
 ID:   46237
 Updated by:   paj...@php.net
 Reported By:  ka...@php.net
-Status:   Open
+Status:   Closed
 Bug Type: Feature/Change Request
 Operating System: Windows Vista
 PHP Version:  5.3.0alpha2
-Assigned To:  
+Assigned To:  pajoye
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.




Previous Comments:


[2008-10-05 13:18:34] ka...@php.net

Description:

I've noticed that theres really many repeated compiler warnings
especially on Windows, so here goes:


Zend Engine:
HEAD: http://phpfi.com/360836
PHP_5_3: http://phpfi.com/360837

PHP:
In both HEAD and PHP_5_3 theres a repeated compiler warning C4142
(benign redefinition of type):
C:\Program Files\Microsoft SDKs\Windows\v6.0A\include\Ws2tcpip.h(502) :
warning C4142: benign redefinition of type

I looked at Ws2tcpip.h, and it seems to be redefining socklen_t which
is in the Windows SDK, its only defined if _WIN32_WINNT is >= 6, so it
must be included before the generated config file (main/config.w32.h)
where _WIN32_WINNT is defined to 5. Also main/php.h seems to be defining
socklen_t ifndef HAVE_SOCKLEN_T, which im unsure if the Windows SDK
has.


Note that these are not critical for actual running PHP, but it would
be great to have a cleaner screen on compile ;)


Resources (MSDN on compiler warnings):
C4090: http://msdn.microsoft.com/en-us/library/k77bkb8d.aspx
C4101: http://msdn.microsoft.com/en-us/library/c733d5h9.aspx
C4142: http://msdn.microsoft.com/en-us/library/cbs8z6wh.aspx






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



#45764 [Opn->Bgs]: gethostbyaddr does not return all hostnames

2009-05-04 Thread pajoye
 ID:   45764
 Updated by:   paj...@php.net
 Reported By:  rgil at liquidnet dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: CentOS 5U2
 PHP Version:  5.2.6
 New Comment:

See previous comment.


Previous Comments:


[2008-08-08 18:13:15] j...@php.net

Yes, it's supposed to only return one.



[2008-08-08 14:00:48] rgil at liquidnet dot com

Description:

gethostbyaddr does not return an array of hosts. Since 'host' on a
linux/unix based system will return all of them for a specific IP, I
think this should too. If it was intended to be this way, then this
should be a feature request. If this function was intended to mimic the
gnu host command, then this should be classified as a bug.

Reproduce code:
---
Only returns one entry. All versions.

Expected result:

Should return all host names associated with ip as gnu host does. Or an
added feature to return all hosts as an array.

Actual result:
--
Single host returned.





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



#48147 [NEW]: iconv with //IGNORE cuts the string

2009-05-04 Thread kulakov74 at yandex dot ru
From: kulakov74 at yandex dot ru
Operating system: Linux
PHP version:  5.2.9
PHP Bug Type: ICONV related
Bug description:  iconv with //IGNORE cuts the string

Description:

iconv() without //IGNORE as known cuts the string at the first illegal
character, but with //IGNORE it should not. Still, I get a truncated text,
but not at the point where the character is. Sorry the actual PHP version
is 5.2.6, but I cannot upgrade it. Just to let you know. Can you test that
with the last version? Please download the file from
http://www.oppcharts.com/iconv.html

Reproduce code:
---
$Body1=... //read the file

echo(strlen($Body1)."\n");
$Body2=iconv('UTF-8', 'ISO-8859-1', $Body1);
echo(strlen($Body2)."\n");

$Body2=iconv('UTF-8', 'ISO-8859-1//IGNORE', $Body1);
echo(strlen($Body2)."\n");



Expected result:

15323
Notice: iconv(): Detected an illegal character in input string in
/home/doldon/html/tdnam/dev.php on line 18
3588
---
15323
15321 - I can get this if I use //TRANSLIT or when I run the test on my
home Windows PHP 4


Actual result:
--
15323
Notice: iconv(): Detected an illegal character in input string in
/home/doldon/html/tdnam/dev.php on line 18
3588
---
15323
Notice: iconv(): Detected an illegal character in input string in
/home/doldon/html/tdnam/dev.php on line 18
8157 - THIS IS THE PROBLEM

-- 
Edit bug report at http://bugs.php.net/?id=48147&edit=1
-- 
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=48147&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=48147&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=48147&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=48147&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=48147&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=48147&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=48147&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=48147&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=48147&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=48147&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=48147&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=48147&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=48147&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=48147&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=48147&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=48147&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=48147&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=48147&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=48147&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=48147&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=48147&r=mysqlcfg



#44994 [Com]: exec() produces zombie processes on Windows, hangs Apache

2009-05-04 Thread mk1992 at hotmail dot com
 ID:   44994
 Comment by:   mk1992 at hotmail dot com
 Reported By:  dbarrett at vistaprint dot com
 Status:   Assigned
 Bug Type: Program Execution
 Operating System: win32 only - 2003 Server, 64-bit
 PHP Version:  5.2.6
 Assigned To:  pajoye
 New Comment:

same problem here, php 5.2.9, w2k3, IIS: shell_exec hanging on
production server but not on development server.  Can't do downgrade to
5.1.x.


Previous Comments:


[2009-04-28 22:52:53] diackne at gmail dot com

I have the same issue in windows 2008 web server iis 7 !!!



[2009-04-22 02:03:38] aliks0905 at gmail dot com

I have the same issue as well. I use the exec() function to
simultaneously upload files and sometimes cmd.exe freezes and all
following uploads fail.

I run on a Windows 2003 Server using Apache 2.2.11 and PHP 5.2.9

Looking forward to hearing a solution.



[2009-02-27 18:58:20] alex at alexi dot ch

Hi all,

I can fully confirm the above behaviour on the Windows platform. We are
using Apache FOP to create PDF-Files out of PHP, so we are invoking
exec() to start the command line FOP processor.
With several versions of PHP 5.2.x (5.2.4, 5.2.6, 5.2.8), this problem
occurs soon as more than one user is invoking the exec().

Luckily we could not reproduce this behaviour using PHP 5.1.x, so
downgrading to a 5.1.x version might also be an option for you.

Regards
alex



[2009-01-16 17:17:44] schreiber at cs-itc dot de

Same problems on w2k3 server x64 SP2 with apache 2.2.8 + 2.2.11 and  
php 5.2.0 up to 5.2.8 -> using exec() the shellproc cmd.exe hangs and
httpd is blocked for further ops, can just be cured by restart of apache
services. Workaround with COM object helps, but thats no lucky
solution...



[2009-01-13 18:44:15] irdev at rogers dot com

I have been experiencing this issue as well. The server is Windows 2003
with all patches up to date running IIS. PHP version is 5.2.5. I am
running a commandline process using exec(). I have also tried passthru
and shell_exec with the same results. Problem is intermittent and can
not be replicated on demand. The processes themselves can not be killed
until the IIS worker process is killed first although they do complete
all the work they are supposed to. The commands do not die on script
timeout.



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/44994

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



#45213 [Ver->Csd]: imap_utf7_encode() computes wrong UTF-7 data

2009-05-04 Thread thomas dot jarosch at intra2net dot com
 ID:   45213
 User updated by:  thomas dot jarosch at intra2net dot com
 Reported By:  thomas dot jarosch at intra2net dot com
-Status:   Verified
+Status:   Closed
 Bug Type: IMAP related
 Operating System: *
 PHP Version:  5.*, 6CVS (2009-04-27)
 New Comment:

Sounds good. Thanks!


Previous Comments:


[2009-05-02 18:03:40] paj...@php.net

I added imap_utf8_to_mutf7 and imap_mutf7_to_utf8 to php 5.3 and 6.0.
5.2 can't accept new features, you can easily backport the two functions
from 5.3. However I won't fix the utf7_encode/decode functions as they
should actually use the imap API and UTF-8. 



[2009-04-28 07:53:49] thomas dot jarosch at intra2net dot com

As far as I know, iconv does not support IMAP modified UTF7 out of
the box. Atleast my version 1.9.1 does not and I have a patch for
exactly that. Though we can't rely on people having a patched iconv
version.

The c-client IMAP library has support for UTF8 <-> modified UTF7.
Maybe that would be an option?



[2009-04-27 20:31:15] paj...@php.net

Should we not simply rely on iconv in 5.2/5.3 and ICU in HEAD?



[2009-04-27 19:07:23] j...@php.net

Here is short and reliable test:

# sapi/cli/php -r '$tst = mb_convert_encoding("täst", "ISO-8859-1", 
"UTF8"); echo $tst, "\n"; echo imap_utf7_encode($tst), "\n",  
mb_convert_encoding($tst, "UTF7-IMAP", "ISO-8859-1"), "\n";'




[2008-06-09 13:17:53] thomas dot jarosch at intra2net dot com

Description:

Hello together,

I tried to encode german umlauts using imap_utf7_encode(),
but the computed string is not understood by the cyrus IMAP server.

This is pretty much related to bug #15630, but now I had the
help of a coworker who is pretty fast decoding base64 by hand :-)

UTF-7 is defined to encode special characters as two byte UTF-16
stream.
Normally the ISO-8859-1 string "täst" should be encoded into t&AOQ-st,
which corresponds to 0x00, 0xe4.

The current code in PHP 5.2.6 encodes it to t&5A-st,
which is 0xe4 without the leading 0x00.

Would be nice if that could be resolved since it's
not compatible with most IMAP implementations.
Bug #15630 is around since 2002.

Cheers,
Thomas


Reproduce code:
---
echo imap_utf7_encode("täst");

Expected result:

t&AOQ-st

Actual result:
--
t&5A-st





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



#46377 [Bgs]: Problem loading oci.dll with multiple Oracle clients.

2009-05-04 Thread phsanghvi at gmail dot com
 ID:   46377
 User updated by:  phsanghvi at gmail dot com
 Reported By:  phsanghvi at gmail dot com
 Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: Windows XP
 PHP Version:  5.2.6
 New Comment:

I am sorry to see such a late, and impolite response !!!

Immediately after posting my request, I had modified php_oci8.dll, so
that it does not look for oci.dll, but for another file (I changed it to
ocp.dll), and then renamed oci.dll of newer version to ocp.dll.

My application has been working fine since then.

Your action of putting the status as "Bogus" is highly disappointing.
Instead of considering the suggestions of people, you are trying to
discourage them.

I faced a unique situation, where I had to use PHP with Oracle Instant
Client, and was constrained to use older Oracle version also on the
server. I made a suggestion for overcoming such a problem, but your
arrogant approach is incomprehensible.

Sorry to see developers like you. Shame on you.


Previous Comments:


[2009-05-04 15:23:39] paj...@php.net

Set your PATH correctly and it will find it. We can't control what will
happen before we get the hand.



[2008-10-24 11:12:38] phsanghvi at gmail dot com

Description:

While working on a machine having multiple Oracle clients installed,
'php_oci8.dll' extension looks for 'oci.dll' file in the first oracle
directory in %path%.

If the first Oracle in %path% is of version 9 or less, extension is
enabled, but it does not work.

IMO, 'php_oci8.dll' should be modified to read the location of
'oci.dll' from 'php.ini' file, where user should set it.

This will help in using multiple Oracle clients and multiple
applications togather.






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



#45188 [Opn->Fbk]: Crash during request shutdown if mail server shuts down

2009-05-04 Thread pajoye
 ID:   45188
 Updated by:   paj...@php.net
 Reported By:  thomas dot jarosch at intra2net dot com
-Status:   Open
+Status:   Feedback
 Bug Type: IMAP related
 Operating System: linux
 PHP Version:  5.2.6
 Assigned To:  fb-req-jani


Previous Comments:


[2009-05-04 13:24:46] thomas dot jarosch at intra2net dot com

Thanks for checking. I'll test again this week and report back.



[2009-04-30 09:40:13] j...@php.net

Compiles fine for me. Try again with latest snapshot. (make sure to 
unpack and build in clean dirs..)



[2009-04-29 14:27:02] thomas dot jarosch at intra2net dot com

Is the latest snapshot compilable?

I get this:

/usr/src/redhat/BUILD/php5.2-200904291230/main/streams/cast.c:129:
error: expected '=', ',', ';', 'asm' or '__attribute__' before
'stream_cookie_functions'
/usr/src/redhat/BUILD/php5.2-200904291230/main/streams/cast.c: In
function '_php_stream_cast':
/usr/src/redhat/BUILD/php5.2-200904291230/main/streams/cast.c:181:
error: 'stream_cookie_functions' undeclared (first use in this
function)
/usr/src/redhat/BUILD/php5.2-200904291230/main/streams/cast.c:181:
error: (Each undeclared identifier is reported only once
/usr/src/redhat/BUILD/php5.2-200904291230/main/streams/cast.c:181:
error: for each function it appears in.)
/usr/src/redhat/BUILD/php5.2-200904291230/main/streams/cast.c:181:
warning: assignment makes pointer from integer without a cast
/usr/src/redhat/BUILD/php5.2-200904291230/main/streams/cast.c:221:
warning: passing argument 3 of '_php_stream_cast' makes pointer from
integer without a cast



[2009-04-27 19:14:40] j...@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/





[2008-06-05 15:41:29] thomas dot jarosch at intra2net dot com

Description:

Hello together,

if you use a webmail applications like Horde's IMP and restart the 
server while an IMAP command is processing, PHP segfaults on request 
shutdown.

Here's a backtrace of the crash:

(gdb) bt
#0  0x632f6564 in ?? ()
#1  0x01a6b575 in mail_close_full (stream=0x87b8ad8, options=0) at 
mail.c:1361
#2  0x01a494e3 in mail_close_it (rsrc=0xb7977840) 
at /usr/src/redhat/BUILD/php-5.2.6/ext/imap/php_imap.c:229
#3  0x006dacc7 in list_entry_destructor (ptr=0xb7977840) 
at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_list.c:184
#4  0x006d8a3a in zend_hash_del_key_or_index (ht=0x7cb480, arKey=0x0, 
nKeyLength=0, h=81, flag=1) 
at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_hash.c:497
#5  0x006da915 in _zend_list_delete (id=81) 
at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_list.c:58
#6  0x006cb9ed in _zval_dtor_func (zvalue=0xb79d7a74) 
at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_variables.c:60
#7  0x006be95e in _zval_dtor (zvalue=0xb79d7a74) 
at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_variables.h:35
#8  0x006bebac in _zval_ptr_dtor (zval_ptr=0xb79a9610) 
at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_execute_API.c:414
#9  0x006d8b33 in zend_hash_destroy (ht=0xb7a1a71c) 
at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_hash.c:526
#10 0x006eae64 in zend_object_std_dtor (object=0xb7b9bf08) 
at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_objects.c:45
#11 0x006eb287 in zend_objects_free_object_storage 
(object=0xb7b9bf08) 
at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_objects.c:122
#12 0x006eec3f in zend_objects_store_free_object_storage 
(objects=0x7cb528) 
at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_objects_API.c:89
#13 0x006be7c7 in shutdown_executor () 
at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_execute_API.c:299
#14 0x006cd48d in zend_deactivate () 
at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend.c:860
#15 0x0067d8d2 in php_request_shutdown (dummy=0x0) 
at /usr/src/redhat/BUILD/php-5.2.6/main/main.c:1486
#16 0x00742f2f in php_apache_request_dtor (r=0x8776f70) 
at
/usr/src/redhat/BUILD/php-5.2.6/sapi/apache2handler/sapi_apache2.c:469
#17 0x007438ce in php_handler (r=0x8776f70) 
at
/usr/src/redhat/BUILD/php-5.2.6/sapi/apache2handler/sapi_apache2.c:641
#18 0x08065f19 in ap_run_handler ()
#19 0x08068f61 in ap_invoke_handler ()
#20 0x080639d8 in ap_process_request ()
#21 0x0805e6b8 in _start ()

I took a look at the structures in #1 mail_close_full 
(stream=0x87b8ad8, options=0), the memory was totally bogus and 
already reused. To me this looks like a use-after-free issue.

While debugging I've found another crash in c-client's IMAP extension 
and I will submit a patch upstream.

I was unable to find the source of this crash, but I suspect the 
connection already gets closed and then PHP tries to close it twice 
or something like th

#9441 [Opn->Bgs]: New feature for foreach control structure

2009-05-04 Thread pajoye
 ID:   9441
 Updated by:   paj...@php.net
 Reported By:  php at leon dot brooks dot fdns dot net
-Status:   Open
+Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: (all, using) Linux 2.2.18
 PHP Version:  4.0.4pl1
 New Comment:

Use file()


Previous Comments:


[2002-08-02 09:21:50] parham_m_s at hotmail dot com

i recently converted from perl to php and this was the first thing i
realized.  The foreach construct should be implemented into files
because it's just eyepleasing (and easier) for some people.  The same
idea should also be applied to opendir (or even dumping an entire
directory tree into an array).



[2001-02-25 09:02:14] php at leon dot brooks dot fdns dot net

Would find it convenient to do this:

$filehandle=fopen("file","r");
foreach ($filehandle as $line) {
# process line (line ends stripped off)
}
fclose ($filehandle);

...and even this...

$filehandle=fopen("file","r");
foreach ($filehandle as $line[]) {
# $line[0] = whole line sans ends
# $line[1] = first word (exploded out gawk-like)
# $line[2] = second word, etc
}
fclose ($filehandle);

...just a thought.





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



#46377 [Bgs]: Problem loading oci.dll with multiple Oracle clients.

2009-05-04 Thread pajoye
 ID:   46377
 Updated by:   paj...@php.net
 Reported By:  phsanghvi at gmail dot com
 Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: Windows XP
 PHP Version:  5.2.6
 New Comment:

Shame on me for telling you how it works? No comment.


Previous Comments:


[2009-05-04 15:41:03] phsanghvi at gmail dot com

I am sorry to see such a late, and impolite response !!!

Immediately after posting my request, I had modified php_oci8.dll, so
that it does not look for oci.dll, but for another file (I changed it to
ocp.dll), and then renamed oci.dll of newer version to ocp.dll.

My application has been working fine since then.

Your action of putting the status as "Bogus" is highly disappointing.
Instead of considering the suggestions of people, you are trying to
discourage them.

I faced a unique situation, where I had to use PHP with Oracle Instant
Client, and was constrained to use older Oracle version also on the
server. I made a suggestion for overcoming such a problem, but your
arrogant approach is incomprehensible.

Sorry to see developers like you. Shame on you.



[2009-05-04 15:23:39] paj...@php.net

Set your PATH correctly and it will find it. We can't control what will
happen before we get the hand.



[2008-10-24 11:12:38] phsanghvi at gmail dot com

Description:

While working on a machine having multiple Oracle clients installed,
'php_oci8.dll' extension looks for 'oci.dll' file in the first oracle
directory in %path%.

If the first Oracle in %path% is of version 9 or less, extension is
enabled, but it does not work.

IMO, 'php_oci8.dll' should be modified to read the location of
'oci.dll' from 'php.ini' file, where user should set it.

This will help in using multiple Oracle clients and multiple
applications togather.






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



#9266 [Ana->WFx]: Unable to load 14 of php's extensions

2009-05-04 Thread pajoye
 ID:   9266
 Updated by:   paj...@php.net
 Reported By:  mikemyers at swi dot hu
-Status:   Analyzed
+Status:   Wont fix
 Bug Type: Feature/Change Request
 Operating System: WinMe, Win98, Win2000
 PHP Version:  4.0.4pl1
 New Comment:

We are sorry, but we can not support PHP 4 related problems anymore.
Momentum is gathering for PHP 6, and we think supporting PHP 4 will
lead to a waste of resources which we want to put into getting PHP 6
ready.




Previous Comments:


[2004-12-23 12:35:41] vishonly at yahoo dot co dot in

i completly agree
i also spend almost 2 days
for connecting to remote sybase server

couldnot load php_sybase_ct.dll

i know it requires other files like libct.dll but how to get them

i know its not php bug but atleast the ppl who have worked on this can
reply



[2002-01-06 13:34:13] irc-h...@php.net

The extensions are all (mostly) listed in a table at
http://www.php.net/manual/en/install.windows.php#install.windows.extensions
which also lists if the extension is dependent upon a specific library
(another dll).

Most of the extension documentation also lists 'You need xxx to use
this extension', or 'In order to use this extension you need to install
xxx', etc.  I think it is clearly documented in the manual.  A
possibility would be to improve the error message, perhaps 'php_xxx.dll:
 This extension requires xxx library installed', something simliar would
be helpful.

Changing to feature request.



[2002-01-06 13:18:40] j...@php.net

so better documentation is needed for extensions that rely on external
libraries.



[2001-02-14 20:07:11] mikemyers at swi dot hu

Yes, a more detailed error message, or/and two more lines in the manual
could have saved me some time. And maybe it would for others too.

Thank you.



[2001-02-14 16:49:32] hholz...@php.net

all of theese extensions depend on other DLLs 
being installed on your system
like, for example, sybase_ct client DLLs
(this is the native sybase call interface, _not_ the ODBC stuff)

maybe we could improve the error message?
(moved to feature request)



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/9266

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



#48148 [NEW]: dom loadHTMLFile has problems with namespaces

2009-05-04 Thread bz at datenkueche dot com
From: bz at datenkueche dot com
Operating system: linux, bsd
PHP version:  5.2.9
PHP Bug Type: DOM XML related
Bug description:  dom loadHTMLFile has problems with namespaces

Description:

There are new problems with DOM and loadHTMLFile

If a document has  the default namespace http://www.w3.org/1999/xhtml the
namespace is duplicated.


There is a bug page at:
http://lamp2.fhstp.ac.at/~lbz/beispiele/ss2009/bug/

Reproduce code:
---
http://www.w3.org/";);
header("Content-type:text/xml");
echo $dom->saveXML($dom->documentElement);
?>

Expected result:

Well formed XML.

Actual result:
--
http://www.w3.org/1999/xhtml";
xmlns="http://www.w3.org/1999/xhtml"; ...

(duplicate namespace)

-- 
Edit bug report at http://bugs.php.net/?id=48148&edit=1
-- 
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=48148&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=48148&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=48148&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=48148&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=48148&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=48148&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=48148&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=48148&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=48148&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=48148&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=48148&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=48148&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=48148&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=48148&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=48148&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=48148&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=48148&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=48148&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=48148&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=48148&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=48148&r=mysqlcfg



#9751 [Opn->Bgs]: WANTED: Informix RESET

2009-05-04 Thread pajoye
 ID:   9751
 Updated by:   paj...@php.net
 Reported By:  michaeld at miller-group dot net
-Status:   Open
+Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: Linux - INFORMIX 2 (very low pri
 PHP Version:  4.0.4pl1
 New Comment:

Report IFX request via pecl.


Previous Comments:


[2009-05-04 15:09:26] paj...@php.net

Report IFX request via pecl.



[2001-03-14 11:44:45] michaeld at miller-group dot net

Also on my Informix wishlist for backend portability is a function that
allows me to reset the database cursor.

This isn't too bad for porting, as I can just use a do-while, but it'd
still be nice...

Thanks,

Michael




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



#14069 [Opn->Bgs]: Need function for Informix

2009-05-04 Thread pajoye
 ID:   14069
 Updated by:   paj...@php.net
 Reported By:  puawat at hotmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: AIX 4.3.3
 PHP Version:  4.0.6
 New Comment:

Report IFX request via pecl.


Previous Comments:


[2001-11-18 23:46:41] puawat at hotmail dot com


Can provide new function or give me the workaround (sample code) that
return me the real no. of rows from Select statement.






[2001-11-15 08:05:31] puawat at hotmail dot com

HI,

I use PHP 4.0.6 connect to Informix IDS2000 9.21.UC5 on AIX 4.3.3.
I would like to know
the number of rows that return from select statement. I try to use
ifx_affected_rows to get this 
info but it return the estimate no of rows not the exactly. Can you
provide the function for informix
that return the real number for the select statement.
Thank you for your help.

Regards,
Pornchai





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



#9750 [Opn->Bgs]: Informix Fetch Array

2009-05-04 Thread pajoye
 ID:   9750
 Updated by:   paj...@php.net
 Reported By:  michaeld at miller-group dot net
-Status:   Open
+Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: Linux - INFORMIX
 PHP Version:  4.0.4pl1
 New Comment:

Report IFX request via pecl.


Previous Comments:


[2001-03-14 11:42:28] michaeld at miller-group dot net

I would like to have an Informix function very similar in nature to
mysql_fetch_array, where I can access returns by either an index number
or the associated field name.

This would be IMMENSLY helpful, allowing me to change code a bit
faster.  As well, it would make changing application database backends a
BIT easier if the software was previously written to make use of
enumerated array returns.

Thanks for your consideration.





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



#48034 [Csd->Opn]: PHP crashes when script is 8192 (8KB) bytes long

2009-05-04 Thread pajoye
 ID:   48034
 Updated by:   paj...@php.net
 Reported By:  ninzya at inbox dot lv
-Status:   Closed
+Status:   Open
 Bug Type: Reproducible crash
 Operating System: *
 PHP Version:  5.*, 6CVS (2009-04-21)
 Assigned To:  dmitry
 New Comment:

Not fixed. Only a temp hack.


Previous Comments:


[2009-04-28 07:16:19] dmi...@php.net

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.





[2009-04-22 11:09:23] bj...@php.net

See also bug#48043



[2009-04-21 17:20:21] ninzya at inbox dot lv

I did everything mentioned in
http://bugs.php.net/bugs-generating-backtrace-win32.php

and got these results:

Thread 250 - System ID 5552
Entry point   msvcrt!_endthreadex+3a 
Create time   21.04.2009 15:20:51 
Time spent in user mode   0 Days 0:0:0.656 
Time spent in kernel mode   0 Days 0:0:0.921 


Function Arg 1 Arg 2 Arg 3   Source 
php5ts!lex_scan+447c 0550fa34 010f54a0 002f
php5ts!zend_register_auto_global+11f  




[2009-04-21 15:31:46] lbarn...@php.net

It seems related to http://bugs.php.net/bug.php?id=47596 . Not exactly
the same problem, though.
It seems php_stream_open_for_zend() does not mmap() enough for
ZEND_MMAP_AHEAD (PHP_STREAM_OPTION_MMAP_API in plain_wrapper adjusts the
mmap length to the filesize, so ignoring ZEND_MMAP_AHEAD), and this may
crash when the parser reads ahead of the mmap()ed region. 



[2009-04-21 11:50:51] ninzya at inbox dot lv

PHP is installed as apache module.
No fancy filtering, default php/apache installation.
All php modules disabled.

Bug hits only if file size is 8KB exactly (8192 bytes). PHP 5.2.9 also
is affected.

By the way, Apache 2.2 is not affected. Seems this is apache 2.0
specific problem. Don't know where to post this issue, here, or in
Apache bugtracker.



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/48034

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



#45764 [Bgs]: gethostbyaddr does not return all hostnames

2009-05-04 Thread rgil at liquidnet dot com
 ID:   45764
 User updated by:  rgil at liquidnet dot com
 Reported By:  rgil at liquidnet dot com
 Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: CentOS 5U2
 PHP Version:  5.2.6
 New Comment:

Can you please update this to a feature request? Status should not be
bogus.


Previous Comments:


[2009-05-04 15:26:40] paj...@php.net

See previous comment.



[2008-08-08 18:13:15] j...@php.net

Yes, it's supposed to only return one.



[2008-08-08 14:00:48] rgil at liquidnet dot com

Description:

gethostbyaddr does not return an array of hosts. Since 'host' on a
linux/unix based system will return all of them for a specific IP, I
think this should too. If it was intended to be this way, then this
should be a feature request. If this function was intended to mimic the
gnu host command, then this should be classified as a bug.

Reproduce code:
---
Only returns one entry. All versions.

Expected result:

Should return all host names associated with ip as gnu host does. Or an
added feature to return all hosts as an array.

Actual result:
--
Single host returned.





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



#23019 [Opn->Bgs]: Allow PHP to prepare Informix cursors with "placeholders"

2009-05-04 Thread pajoye
 ID:   23019
 Updated by:   paj...@php.net
 Reported By:  johnson at nicusa dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: Solaris 8
 PHP Version:  4.3.1
 New Comment:

Report IFX request via pecl.


Previous Comments:


[2003-04-02 08:59:31] johnson at nicusa dot com

With many other languages that access an Informix database, a
placeholder (question mark) in the VALUES list is passed in a string as
an argument in the USING clause of the EXECUTE (or PUT) statement:

EXEC SQL PREPARE p FROM "INSERT INTO SomeTable VALUES(..., ?, ...)";
EXEC SQL EXECUTE p USING :very_long_string_variable;

The same technique works with UPDATE, of course. PHP doesn't accept
placeholders, so that's problematic. The ability to prepare a statement
one time at the beginning of say, a large load or update process or a
query used many times (probably happen more in CLI than CGI) is MUCH
more efficient, as the engine does not have to have PREPARE and FREE in
the loop every time the cursor is executed.

I suggest that the function ifx_prepare be changed to accept question
marks as placeholders in the query.

Then ifx_do could be coded to accept a series of arguments, or just an
array containing arguments in the proper order to populate the cursor
query before execution.

Thanks for your consideration. jj.





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



#45188 [Fbk->Opn]: Crash during request shutdown if mail server shuts down

2009-05-04 Thread thomas dot jarosch at intra2net dot com
 ID:   45188
 User updated by:  thomas dot jarosch at intra2net dot com
 Reported By:  thomas dot jarosch at intra2net dot com
-Status:   Feedback
+Status:   Open
 Bug Type: IMAP related
 Operating System: linux
 PHP Version:  5.2.6
 Assigned To:  fb-req-jani
 New Comment:

Thanks for checking. I'll test again this week and report back.


Previous Comments:


[2009-04-30 09:40:13] j...@php.net

Compiles fine for me. Try again with latest snapshot. (make sure to 
unpack and build in clean dirs..)



[2009-04-29 14:27:02] thomas dot jarosch at intra2net dot com

Is the latest snapshot compilable?

I get this:

/usr/src/redhat/BUILD/php5.2-200904291230/main/streams/cast.c:129:
error: expected '=', ',', ';', 'asm' or '__attribute__' before
'stream_cookie_functions'
/usr/src/redhat/BUILD/php5.2-200904291230/main/streams/cast.c: In
function '_php_stream_cast':
/usr/src/redhat/BUILD/php5.2-200904291230/main/streams/cast.c:181:
error: 'stream_cookie_functions' undeclared (first use in this
function)
/usr/src/redhat/BUILD/php5.2-200904291230/main/streams/cast.c:181:
error: (Each undeclared identifier is reported only once
/usr/src/redhat/BUILD/php5.2-200904291230/main/streams/cast.c:181:
error: for each function it appears in.)
/usr/src/redhat/BUILD/php5.2-200904291230/main/streams/cast.c:181:
warning: assignment makes pointer from integer without a cast
/usr/src/redhat/BUILD/php5.2-200904291230/main/streams/cast.c:221:
warning: passing argument 3 of '_php_stream_cast' makes pointer from
integer without a cast



[2009-04-27 19:14:40] j...@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/





[2008-06-05 15:41:29] thomas dot jarosch at intra2net dot com

Description:

Hello together,

if you use a webmail applications like Horde's IMP and restart the 
server while an IMAP command is processing, PHP segfaults on request 
shutdown.

Here's a backtrace of the crash:

(gdb) bt
#0  0x632f6564 in ?? ()
#1  0x01a6b575 in mail_close_full (stream=0x87b8ad8, options=0) at 
mail.c:1361
#2  0x01a494e3 in mail_close_it (rsrc=0xb7977840) 
at /usr/src/redhat/BUILD/php-5.2.6/ext/imap/php_imap.c:229
#3  0x006dacc7 in list_entry_destructor (ptr=0xb7977840) 
at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_list.c:184
#4  0x006d8a3a in zend_hash_del_key_or_index (ht=0x7cb480, arKey=0x0, 
nKeyLength=0, h=81, flag=1) 
at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_hash.c:497
#5  0x006da915 in _zend_list_delete (id=81) 
at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_list.c:58
#6  0x006cb9ed in _zval_dtor_func (zvalue=0xb79d7a74) 
at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_variables.c:60
#7  0x006be95e in _zval_dtor (zvalue=0xb79d7a74) 
at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_variables.h:35
#8  0x006bebac in _zval_ptr_dtor (zval_ptr=0xb79a9610) 
at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_execute_API.c:414
#9  0x006d8b33 in zend_hash_destroy (ht=0xb7a1a71c) 
at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_hash.c:526
#10 0x006eae64 in zend_object_std_dtor (object=0xb7b9bf08) 
at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_objects.c:45
#11 0x006eb287 in zend_objects_free_object_storage 
(object=0xb7b9bf08) 
at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_objects.c:122
#12 0x006eec3f in zend_objects_store_free_object_storage 
(objects=0x7cb528) 
at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_objects_API.c:89
#13 0x006be7c7 in shutdown_executor () 
at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend_execute_API.c:299
#14 0x006cd48d in zend_deactivate () 
at /usr/src/redhat/BUILD/php-5.2.6/Zend/zend.c:860
#15 0x0067d8d2 in php_request_shutdown (dummy=0x0) 
at /usr/src/redhat/BUILD/php-5.2.6/main/main.c:1486
#16 0x00742f2f in php_apache_request_dtor (r=0x8776f70) 
at
/usr/src/redhat/BUILD/php-5.2.6/sapi/apache2handler/sapi_apache2.c:469
#17 0x007438ce in php_handler (r=0x8776f70) 
at
/usr/src/redhat/BUILD/php-5.2.6/sapi/apache2handler/sapi_apache2.c:641
#18 0x08065f19 in ap_run_handler ()
#19 0x08068f61 in ap_invoke_handler ()
#20 0x080639d8 in ap_process_request ()
#21 0x0805e6b8 in _start ()

I took a look at the structures in #1 mail_close_full 
(stream=0x87b8ad8, options=0), the memory was totally bogus and 
already reused. To me this looks like a use-after-free issue.

While debugging I've found another crash in c-client's IMAP extension 
and I will submit a patch upstream.

I was unable to find the source of this crash, but I suspect the 
connection already gets closed and then PHP tries to close it twice 
or something like that.

Reproduce code:
---
Move mails via IMAP to another folder and restart your IMAP s

#9751 [Opn]: WANTED: Informix RESET

2009-05-04 Thread pajoye
 ID:   9751
 Updated by:   paj...@php.net
 Reported By:  michaeld at miller-group dot net
 Status:   Open
 Bug Type: Feature/Change Request
 Operating System: Linux - INFORMIX 2 (very low pri
 PHP Version:  4.0.4pl1
 New Comment:

Report IFX request via pecl.


Previous Comments:


[2001-03-14 11:44:45] michaeld at miller-group dot net

Also on my Informix wishlist for backend portability is a function that
allows me to reset the database cursor.

This isn't too bad for porting, as I can just use a do-while, but it'd
still be nice...

Thanks,

Michael




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



#39637 [Opn->Csd]: Add more curl_setopt options

2009-05-04 Thread pajoye
 ID:   39637
 Updated by:   paj...@php.net
 Reported By:  apinstein at mac dot com
-Status:   Open
+Status:   Closed
 Bug Type: Feature/Change Request
 Operating System: all
 PHP Version:  5.2.0
 New Comment:

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

5.3+


Previous Comments:


[2006-11-26 16:22:53] apinstein at mac dot com

Description:

PHP's curl_setopt is missing many options available in 
libcurl.

Reproduce code:
---
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FTP_USE_EPSV, false);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FAILONERROR, true);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);
curl_setopt($ch, 138 /* CURLOPT_FTP_FILEMETHOD */, 3 /*
CURLFTPMETHOD_SINGLECWD */); // not supported yet; integers don't work
$localFH = fopen($localCopyPath, 'w+');
curl_setopt($ch, CURLOPT_FILE, $localFH);
$ok = curl_exec($ch);
curl_close($ch);


Expected result:

I would expect that the curl extension would keep more up-
to-date with the curl options.

man curl_easy_setopt

will show all available curl options.

Alternatively, it'd be nice if there were a curl_easy_setopt
() function in php so that one could use options even if 
they were not "supported" in php. At present, even passing 
the correct integer values to curl_setopt() will not do 
anything since the php curl extension only accepts defined 
options.

In particular, I need the following options:

option: CURLOPT_FTP_FILEMETHOD
values: CURLFTPMETHOD_MULTICWD, CURLFTPMETHOD_NOCWD, 
CURLFTPMETHOD_SINGLECWD






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



#48148 [Opn->Bgs]: dom loadHTMLFile has problems with namespaces

2009-05-04 Thread chregu
 ID:   48148
 Updated by:   chr...@php.net
 Reported By:  bz at datenkueche dot com
-Status:   Open
+Status:   Bogus
 Bug Type: DOM XML related
 Operating System: linux, bsd
 PHP Version:  5.2.9
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

loadHTMLfile doesn't know anything about namespace (like HTML4) and 
therefore the outcome is unpredictable, use loadxml() to have
namespaces 
treated correctly


Previous Comments:


[2009-05-04 15:48:21] bz at datenkueche dot com

Description:

There are new problems with DOM and loadHTMLFile

If a document has  the default namespace http://www.w3.org/1999/xhtml
the namespace is duplicated.


There is a bug page at:
http://lamp2.fhstp.ac.at/~lbz/beispiele/ss2009/bug/

Reproduce code:
---
http://www.w3.org/";);
header("Content-type:text/xml");
echo $dom->saveXML($dom->documentElement);
?>

Expected result:

Well formed XML.

Actual result:
--
http://www.w3.org/1999/xhtml";
xmlns="http://www.w3.org/1999/xhtml"; ...

(duplicate namespace)





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



#47742 [NoF->Opn]: mb_strtoupper and mb_strtolower failure cases

2009-05-04 Thread fsb at thefsb dot org
 ID:   47742
 User updated by:  fsb at thefsb dot org
 Reported By:  fsb at thefsb dot org
-Status:   No Feedback
+Status:   Open
 Bug Type: mbstring related
 Operating System: os x
 PHP Version:  5.2.9
 Assigned To:  fb-req-jani
 New Comment:

in php5.2-200904162030, mb_strto(upp|low)er appears to be even worse. 
mb_convert_case is now also badly broken.

  $strs = array(
'Iñtërnâtiônàlizætiøn',
'החמאס: רוצים להשלים את עסקת שליט
במהירות האפשרית',
'ايران لا ترى تغييرا في الموقف
الأمريكي',
'独・米で死傷者を出した銃の乱射事件',
'國會預算處公布驚人的赤字數據後',
'이며 세계 경제 회복에 걸림돌이 되고 있다',
'В дагестанском лесном массиве южнее
села Какашура',
'นายประสิทธิ์ รุ่งสะอาด
ปลัดเทศบาล
รักษาการแทนนายกเทศมนตรี
ต.ท่าทองใหม่',
'ભારતીય ટીમનો સુવર્ણ યુગ :
કિવીઝમાં પણ કમાલ',
   
'ཁམས་དཀར་མཛེས་ས་ཁུལ་དུ་རྒྱ་གཞུང་ལ་ཞི་བའི་ངོ་རྒོལ་',
'Χιόνια, βροχές και θυελλώδεις
άνεμοι συνθέτουν το',
'Հայաստանում սկսվել է դատական
համակարգի ձեւավորումը',
'რუსეთი ასევე გეგმავს
სამხედრო');
  print(phpversion() . "\n");
  foreach ($strs as $s) {
print("\n1: $s\n");
print('2: '. ($s = mb_strtoupper($s)) . "\n");
print('3'. ($s = mb_convert_case($s, MB_CASE_UPPER, "UTF-8")) . 
"\n");
print('4: '. ($s = mb_strtolower($s)) . "\n");
print('5: '. ($s = mb_convert_case($s, MB_CASE_LOWER, "UTF-8")) . 
"\n");
  }


./php -f test.php 
5.2.10-dev

1: Iñtërnâtiônàlizætiøn
2: IñTëRNâTIôNàLIZæTIøN
3IÑTËRNÂTIÔNÀLIZÆTIØN
4: i?t?rn?ti?n?liz?ti?n
5: itrntinliztin

1: החמאס: רוצים להשלים את עסקת שליט
במהירות האפשרית
2: החמאס: רוצים להשלים את עסקת שליט
במהירות האפשרית
3החמאס: רוצים להשלים את עסקת שליט
במהירות האפשרית
4: החמאס: רוצים להשלים את עסקת שליט
במהירות האפשרית
5: החמאס: רוצים להשלים את עסקת שליט
במהירות האפשרית

1: ايران لا ترى تغييرا في الموقف
الأمريكي
2: ايران لا ترى تغييرا في الموقف
الأمريكي
3ايران لا ترى تغييرا في الموقف
الأمريكي
4: ??  ??    ?
???
5:   

1: 独・米で死傷者を出した銃の乱射事件
2: Nj?Ã?DZ?Á?ƭ?ł?Ȁ?Â?Ň?Á?Á?Ɋ?Á?Ĺ?Ű?ĺ?Ļ?
3NjÃDZÁƬŁȀÂŇÁÁɊÁĹŰĹĻ
4: ?
5: 

1: 國會預算處公布驚人的赤字數據後
2: Ŝ?Ɯ?ɠ?Ǯ?ș?Ņ?Ÿ?ɩ?ĺ?ǚŭ?ƕ?Ɠ?ž?
3ŜƜƓǮȘŅŸƖĹǙ?ŬǶƓŽ
4: ???
5: ?

1: 이며 세계 경제 회복에 걸림돌이 되고 있다
2: ̝?˩? ̄?ʳ? ʲ?̠? ͚?˳?̗? ʱ?˦?ˏ?̝? ː?ʳ? ̞?ˋ?
3̝˩ ̄ʳ ʲ̠ ͚˳?̗ ʱ˦ˏ̝ ːʳ ̞ˋ
4: ?? ?? ??   ?? ??
5:?   

1: В дагестанском лесном массиве южнее
села Какашура
2: В даг??станском л??сном массив?? южн
с??ла Какашура
3В ДАГ?СТАНСКОМ Л?СНОМ МАССИВ? ЮЖН?? С?ЛА
КАКАШУРА
4: ?  ?? ??? ?  
5:  ? ? ? ?? ? 

1: นายประสิทธิ์ รุ่งสะอาด
ปลัดเทศบาล
รักษาการแทนนายกเทศมนตรี
ต.ท่าทองใหม่
2:  ??? ??
 ?
 ???.??
3   ? .
4:? .
5:? .

1: ભારતીય ટીમનો સુવર્ણ યુગ :
કિવીઝમાં પણ કમાલ
2: ?? ??? ?? ? : ?
??? ?? 
3  ?  : ?  
4:   ?  : ?  
5:   ?  : ?  

1:
ཁམས་དཀར་མཛེས་ས་ཁུལ་དུ་རྒྱ་གཞུང་ལ་ཞི་བའི་ངོ་རྒོལ་
2: ???
??
???
3
4: 
5: 

1: Χιόνια, βροχές και θυελλώδεις άνεμοι
συνθέτουν το
2: Χιόνια, βροχές και θυ??λλώδ??Î

#44560 [NoF->Opn]: Apache crashes with PDO_OCI and both persistent and non-persistent connections.

2009-05-04 Thread jarismar dot php at gmail dot com
 ID:   44560
 User updated by:  jarismar dot php at gmail dot com
-Reported By:  jarismar_silva at adplabs dot com dot br
+Reported By:  jarismar dot php at gmail dot com
-Status:   No Feedback
+Status:   Open
 Bug Type: PDO related
 Operating System: Windows XP SP2
 PHP Version:  5.2.6RC3
 New Comment:

Reproduced with PHP Version 5.2.10-dev (Build Date Apr 26 2009
23:39:22)

Someone else have been able to reproduced this bug ? Here is some
instructions on how to do it :
1. run the snipped once
2. kill the persistent connection on oracle (see sqls on the second
note)
3. run the snipped again

So infortunatelly the bug is not yet fixed on 5.2.10-dev.


Previous Comments:


[2009-05-03 01:00:12] 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".



[2009-04-25 14:57:41] j...@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/





[2008-03-28 15:57:17] jarismar_silva at adplabs dot com dot br

You can more reproduce this error by killing the persistent
connection.
First you need to discovering the SID and Serial# from the persistent 
connection in order to kill it:

This SQL retrieve SID and SERIAL# :
select * from  (
select
  nvl(ses.USERNAME,'ORACLE PROC') username,
  PROGRAM,
  MACHINE,
  ses.status status,
PROCESS pid,
ses.SID SID,
SERIAL#
fromv$session ses,
v$sess_io sio
where   ses.SID = sio.SID
order   by PHYSICAL_READS, ses.USERNAME
) where username = 'RPTDEV7'
order by machine, pid, sid

Then kill the session with
ALTER SYSTEM KILL SESSION ',';



[2008-03-28 14:53:42] jarismar dot php at gmail dot com

Description:

Sometimes our DBAs restart oracle without restarting the apache server,
due to this if apache has persistent connections, those connections are
in invalid state.
 In this scenario trying to connect to oracle results in on of the
following errors:
 ORA-00028: your session has been killed
 ORA-01012: not logged on
 ORA-03113 end-of-file on communication channel
 I'm trying to handle this errors and skipping creating the persistent
connection and then creating a new non-persistent connection (see the
php snippet). I was in hope that doing this could force apache to free
the invalid persistent connection, but instead apache crashes (it seems
a problem freeing the statements).

Reproduce code:
---
try {
  $oPDO = new PDO($sDSN, $sUserName, $sPassword,
array(PDO::ATTR_PERSISTENT => true));
  print "Persistent connection created\n";
  $oPDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (Exception $oE) {
  echo "Error : ".$oE->getMessage()."\n";
  $oPDO = new PDO($sDSN, $sUserName, $sPassword,
array(PDO::ATTR_PERSISTENT => false));
  print "Non persistent connection created\n";
}

try {
  $oStatement = $oPDO->prepare('Select 1+1 as test from dual');
  var_dump($oStatement->execute());
  var_dump($oStatement->fetchAll());
} catch (Exception $oE) {
  echo "Error : ".$oE->getMessage()."\n";
} 

$oPDO = null;

Expected result:

  I expect either the system get ride of invalid persistent connections
or when one create a non-peristent connection it replaces the persistent
one if there is any.


Actual result:
--
  Unhandled exception at 0x0087ac76 (php5ts.dll) in Apache.exe:
0xC005: Access violation reading location 0x002b5ffc.
>   php5ts.dll!_zend_mm_free_int(_zend_mm_heap * heap=0x01ded100, void *
p=0x0005000c)  Line 1960C
php5ts.dll!_efree(void * ptr=0x00265ff8)  Line 2293 + 0xb bytes C
php_pdo_oci.dll!oci_stmt_dtor(_pdo_stmt_t * stmt=0x, void * *
* tsrm_ls=0x01debeb0)  Line 90 + 0x3 bytes  C
php_pdo.dll!free_statement(_pdo_stmt_t * stmt=0x02b9ad48, void * * *
tsrm_ls=0x01debeb0)  Line 2355 + 0x8 bytes  C
php_pdo.dll!php_pdo_stmt_delref(_pdo_stmt_t * stmt=0x02b9ad48, void *
* * tsrm_ls=0x01debeb0)  Line 2397 + 0xb bytes  C
php_pdo.dll!pdo_dbstmt_free_storage(_pdo_stmt_t * stmt=0x02b9ad48,
void * * * tsrm_ls=0x01debeb0)  Line 2402 + 0xf bytes   C
php5ts.dll!zend_objects_store_del_ref_by_handle(unsigned int
handle=2, void * * * tsrm_ls=0x01debeb0)  Line 206 + 0x11 bytes C
php5ts.dll!zend_objects_store_del_ref(_zval_struct *
zobject=0x02b9ab00, void * * * tsrm_ls=0x01debeb0)  Line 169C
php5ts.dll!_zval_dtor_func(_zval_struct * zvalue=0x02b9ab00)  Line
60  C
 

#48141 [Fbk->Asn]: memory leak in zend_execute.c and zend_operators.c

2009-05-04 Thread cellog
 ID:   48141
 Updated by:   cel...@php.net
 Reported By:  greg at chiaraquartet dot net
-Status:   Feedback
+Status:   Assigned
 Bug Type: Scripting Engine problem
 Operating System: ubuntu linux
 PHP Version:  5.3CVS-2009-05-04 (CVS)
 Assigned To:  dmitry
 New Comment:

u...@ubuntu8041:~/workspace/php5$ cat config.nice
#! /bin/sh
#
# Created by configure

'./configure' \
'--enable-debug' \
'--with-zlib' \
'--with-bz2=shared' \
'--enable-cgi' \
"$@"
u...@ubuntu8041:~/workspace/php5$ uname -a
Linux ubuntu8041 2.6.24-23-generic #1 SMP Wed Apr 1 21:47:28 UTC 2009
i686 GNU/Linux
u...@ubuntu8041:~/workspace/php5$ cat CVS/Tag
TPHP_5_3
u...@ubuntu8041:~/workspace/php5$ 





Previous Comments:


[2009-05-04 10:16:39] dmi...@php.net

I'm not able to reproduce it with CVS PHP_5_3.



[2009-05-04 08:03:17] tony2...@php.net

Dmitry, could you look into it?



[2009-05-04 04:24:12] greg at chiaraquartet dot net

Description:

When running a simple file that only instantiates objects using
autoload, there is a memory leak.

The leak appears to be caused by some combination of string
concatenation and exception throwing.  The line that causes the leak is
in Pyrus/src/Pyrus/Registry/Sqlite3.php in the constructor:

if ($path && $path != ':memory:') {
if (dirname($path) . DIRECTORY_SEPARATOR . '.pear2registry'
!= $path) {
$path = $path . DIRECTORY_SEPARATOR .
'.pear2registry';
}
}

The line "$path = $path . DIRECTORY_SEPARATOR . '.pear2registry';"

leaks the value "/usr/local/lib/php/.pear2registry" on my machine, and
the zval allocated for $path.

Reproduce code:
---
http://svn.pear.php.net/PEAR2/all
function __autoload($class)
{
if ($class == 'PEAR2_Exception') {
include __DIR__ . '/Exception/src/Exception.php';
return;
}
$class = str_replace('PEAR2_', '', $class);
$class = str_replace('_', '/', $class);
include __DIR__ . '/Pyrus/src/' . $class . '.php';
}
$a = PEAR2_Pyrus_Config::current();


Expected result:

no output

Actual result:
--
u...@ubuntu8041:~/workspace/all/Pyrus/tests/AtomicFileTransaction/rmrf$
php -n test.phpt
[Sun May  3 22:58:31 2009]  Script:  'test.phpt'
/home/user/workspace/php5/Zend/zend_execute.c(723) :  Freeing
0xB7B52AE4 (20 bytes), script=test.phpt
[Sun May  3 22:58:31 2009]  Script:  'test.phpt'
/home/user/workspace/php5/Zend/zend_operators.c(1231) :  Freeing
0x088CE1EC (34 bytes), script=test.phpt
=== Total 2 memory leaks detected ===






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



#48141 [Asn]: memory leak in zend_execute.c and zend_operators.c

2009-05-04 Thread cellog
 ID:   48141
 Updated by:   cel...@php.net
 Reported By:  greg at chiaraquartet dot net
 Status:   Assigned
 Bug Type: Scripting Engine problem
 Operating System: ubuntu linux
 PHP Version:  5.3CVS-2009-05-04 (CVS)
 Assigned To:  dmitry
 New Comment:

I'm using Ubuntu in a VMWare Fusion image in a MacBook Pro, in case
that is helpful


Previous Comments:


[2009-05-04 17:21:17] cel...@php.net

u...@ubuntu8041:~/workspace/php5$ cat config.nice
#! /bin/sh
#
# Created by configure

'./configure' \
'--enable-debug' \
'--with-zlib' \
'--with-bz2=shared' \
'--enable-cgi' \
"$@"
u...@ubuntu8041:~/workspace/php5$ uname -a
Linux ubuntu8041 2.6.24-23-generic #1 SMP Wed Apr 1 21:47:28 UTC 2009
i686 GNU/Linux
u...@ubuntu8041:~/workspace/php5$ cat CVS/Tag
TPHP_5_3
u...@ubuntu8041:~/workspace/php5$ 






[2009-05-04 10:16:39] dmi...@php.net

I'm not able to reproduce it with CVS PHP_5_3.



[2009-05-04 08:03:17] tony2...@php.net

Dmitry, could you look into it?



[2009-05-04 04:24:12] greg at chiaraquartet dot net

Description:

When running a simple file that only instantiates objects using
autoload, there is a memory leak.

The leak appears to be caused by some combination of string
concatenation and exception throwing.  The line that causes the leak is
in Pyrus/src/Pyrus/Registry/Sqlite3.php in the constructor:

if ($path && $path != ':memory:') {
if (dirname($path) . DIRECTORY_SEPARATOR . '.pear2registry'
!= $path) {
$path = $path . DIRECTORY_SEPARATOR .
'.pear2registry';
}
}

The line "$path = $path . DIRECTORY_SEPARATOR . '.pear2registry';"

leaks the value "/usr/local/lib/php/.pear2registry" on my machine, and
the zval allocated for $path.

Reproduce code:
---
http://svn.pear.php.net/PEAR2/all
function __autoload($class)
{
if ($class == 'PEAR2_Exception') {
include __DIR__ . '/Exception/src/Exception.php';
return;
}
$class = str_replace('PEAR2_', '', $class);
$class = str_replace('_', '/', $class);
include __DIR__ . '/Pyrus/src/' . $class . '.php';
}
$a = PEAR2_Pyrus_Config::current();


Expected result:

no output

Actual result:
--
u...@ubuntu8041:~/workspace/all/Pyrus/tests/AtomicFileTransaction/rmrf$
php -n test.phpt
[Sun May  3 22:58:31 2009]  Script:  'test.phpt'
/home/user/workspace/php5/Zend/zend_execute.c(723) :  Freeing
0xB7B52AE4 (20 bytes), script=test.phpt
[Sun May  3 22:58:31 2009]  Script:  'test.phpt'
/home/user/workspace/php5/Zend/zend_operators.c(1231) :  Freeing
0x088CE1EC (34 bytes), script=test.phpt
=== Total 2 memory leaks detected ===






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



#23979 [Com]: @getimagesize

2009-05-04 Thread cosbat at gmail dot com
 ID:   23979
 Comment by:   cosbat at gmail dot com
 Reported By:  diana at interhotel dot com
 Status:   No Feedback
 Bug Type: GetImageSize related
 Operating System: windows
 PHP Version:  4.3.2
 Assigned To:  wez
 New Comment:

Dear all,

  I am using PHP Version 5.2.0-8+etch11 and I am still getting the
following warning:

[function.getimagesize]: failed to open stream: HTTP request failed!
HTTP/1.1 410. 

  I have seen that this bug was under debate for version 4.x of php.

  I would like to mention that I have tested my website both on Windows
XP and on Linux (debian etch with apache 2) and on both environments I
get the same problem.

  Could you please suggest a workaround?


Previous Comments:


[2003-07-29 07:25:21] sni...@php.net

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.





[2003-07-24 21:09:36] il...@php.net

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

I should note that when encountering an invalid URL getimagesize() will
print a warning (simular to the one shown in prior reports) and return
false. That is not a bug.
If 404 code is returned and the image is valid there is a possibility
that the webserver doing some sort of filtering filtering (based on http
refer or user agent) that PHP does not pass resulting in a 404 error
code being returned by the webserver.



[2003-07-03 03:43:27] diana dot castillo at nvtechnologies dot com

I am the one who originally reported this, but I dont remember my
password to comment on it, my original report was with
di...@interhotel.com email.
I found out that there was something I could change in my error
reporting program so that the error would not print out to the screen .



[2003-07-02 23:44:22] nilanjan at unlimitedfx dot com

getimagesize() fails for remote files on PHP 4.3.2 on SunOS - so I
suppose this kind of a problem is not limited to a Win32 platform...

I get the following error:

Warning: getimagesize(http://www.exoticindiaart.com/panels/wb05sm.jpg):
failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found



[2003-06-03 11:18:58] il...@php.net

I cannot replicate this Linux and the original report suggests that the
script was executed on Windows. So, it is likely this is a win32 only
bug.



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/23979

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



#47871 [Opn]: PHPIniScanDir directive for apache allows scanning for extension ini files

2009-05-04 Thread sriram dot natarajan at gmail dot com
 ID:   47871
 User updated by:  sriram dot natarajan at gmail dot com
 Reported By:  sriram dot natarajan at gmail dot com
 Status:   Open
 Bug Type: Feature/Change Request
 Operating System: unix and linux
 PHP Version:  5.3.0RC1
 Assigned To:  dsp
 New Comment:

how does this work ? will this need to be ported all the sapi's
currently supported by PHP or can it be on a user request basis ? for,
example - i can provide the patch for ISAPI ? will that help ? 

For NSAPI, lot of things are broke as is. for example, php ini dir
itself does not work with recent version of sun web server. I plan to 
file a separate bug for NSAPI and can provide a separate patch to
address this issue for nsapi.  

I don't have lot of experience with thttpd or roxen. Does this patch
need to be ported to those SAPI's as well ? are these SAPI's actively
used by the community ?


Previous Comments:


[2009-05-04 15:12:54] paj...@php.net

David, what's the status about this one? Should it not be for all SAPI
instead?



[2009-04-29 00:01:04] d...@php.net

I think that's a good one. I assign it to me so that we don't forget
about that one.



[2009-04-02 02:47:47] sriram dot natarajan at gmail dot com

hi
 here is the patch to address this issue
http://cr.opensolaris.org/~sn123202/php53-47871.patch
http://cr.opensolaris.org/~sn123202/php52-47871.patch

let me know with your comments..



[2009-04-02 02:28:41] sriram dot natarajan at gmail dot com

Description:

Provide PHPIniScanDir directive similar to PHPIniDir for apache. this
directive can perform the functionality of PHP_INI_SCAN_DIR environment
variable. 

for more information on what PHP_INI_SCAN_DIR, please refer to bug
http://bugs.php.net/bug.php?id=45114

Expected result:

PHPIniScanDir directive should be accepted and php should load
extension specific ini files from this location






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



#23979 [NoF->Fbk]: @getimagesize

2009-05-04 Thread pajoye
 ID:   23979
 Updated by:   paj...@php.net
 Reported By:  diana at interhotel dot com
-Status:   No Feedback
+Status:   Feedback
 Bug Type: GetImageSize related
 Operating System: windows
 PHP Version:  4.3.2
 Assigned To:  wez
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




Previous Comments:


[2009-05-04 18:16:56] cosbat at gmail dot com

Dear all,

  I am using PHP Version 5.2.0-8+etch11 and I am still getting the
following warning:

[function.getimagesize]: failed to open stream: HTTP request failed!
HTTP/1.1 410. 

  I have seen that this bug was under debate for version 4.x of php.

  I would like to mention that I have tested my website both on Windows
XP and on Linux (debian etch with apache 2) and on both environments I
get the same problem.

  Could you please suggest a workaround?



[2003-07-29 07:25:21] sni...@php.net

No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.





[2003-07-24 21:09:36] il...@php.net

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

I should note that when encountering an invalid URL getimagesize() will
print a warning (simular to the one shown in prior reports) and return
false. That is not a bug.
If 404 code is returned and the image is valid there is a possibility
that the webserver doing some sort of filtering filtering (based on http
refer or user agent) that PHP does not pass resulting in a 404 error
code being returned by the webserver.



[2003-07-03 03:43:27] diana dot castillo at nvtechnologies dot com

I am the one who originally reported this, but I dont remember my
password to comment on it, my original report was with
di...@interhotel.com email.
I found out that there was something I could change in my error
reporting program so that the error would not print out to the screen .



[2003-07-02 23:44:22] nilanjan at unlimitedfx dot com

getimagesize() fails for remote files on PHP 4.3.2 on SunOS - so I
suppose this kind of a problem is not limited to a Win32 platform...

I get the following error:

Warning: getimagesize(http://www.exoticindiaart.com/panels/wb05sm.jpg):
failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/23979

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



#48034 [Opn->Asn]: PHP crashes when script is 8192 (8KB) bytes long

2009-05-04 Thread jani
 ID:   48034
 Updated by:   j...@php.net
 Reported By:  ninzya at inbox dot lv
-Status:   Open
+Status:   Assigned
 Bug Type: Reproducible crash
 Operating System: *
 PHP Version:  5.*, 6CVS (2009-04-21)
 Assigned To:  dmitry


Previous Comments:


[2009-05-04 16:06:37] paj...@php.net

Not fixed. Only a temp hack.



[2009-04-28 07:16:19] dmi...@php.net

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.





[2009-04-22 11:09:23] bj...@php.net

See also bug#48043



[2009-04-21 17:20:21] ninzya at inbox dot lv

I did everything mentioned in
http://bugs.php.net/bugs-generating-backtrace-win32.php

and got these results:

Thread 250 - System ID 5552
Entry point   msvcrt!_endthreadex+3a 
Create time   21.04.2009 15:20:51 
Time spent in user mode   0 Days 0:0:0.656 
Time spent in kernel mode   0 Days 0:0:0.921 


Function Arg 1 Arg 2 Arg 3   Source 
php5ts!lex_scan+447c 0550fa34 010f54a0 002f
php5ts!zend_register_auto_global+11f  




[2009-04-21 15:31:46] lbarn...@php.net

It seems related to http://bugs.php.net/bug.php?id=47596 . Not exactly
the same problem, though.
It seems php_stream_open_for_zend() does not mmap() enough for
ZEND_MMAP_AHEAD (PHP_STREAM_OPTION_MMAP_API in plain_wrapper adjusts the
mmap length to the filesize, so ignoring ZEND_MMAP_AHEAD), and this may
crash when the parser reads ahead of the mmap()ed region. 



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/48034

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



#47742 [Opn->Fbk]: mb_strtoupper and mb_strtolower failure cases

2009-05-04 Thread jani
 ID:   47742
 Updated by:   j...@php.net
 Reported By:  fsb at thefsb dot org
-Status:   Open
+Status:   Feedback
 Bug Type: mbstring related
 Operating System: os x
 PHP Version:  5.2.9
 Assigned To:  fb-req-jani
 New Comment:

Please provide a bit shorter example script. Or does the bug only
appear 
with such long strings..?


Previous Comments:


[2009-05-04 17:00:15] fsb at thefsb dot org

in php5.2-200904162030, mb_strto(upp|low)er appears to be even worse. 
mb_convert_case is now also badly broken.

  $strs = array(
'Iñtërnâtiônàlizætiøn',
'החמאס: רוצים להשלים את עסקת שליט
במהירות האפשרית',
'ايران لا ترى تغييرا في الموقف
الأمريكي',
'独・米で死傷者を出した銃の乱射事件',
'國會預算處公布驚人的赤字數據後',
'이며 세계 경제 회복에 걸림돌이 되고 있다',
'В дагестанском лесном массиве южнее
села Какашура',
'นายประสิทธิ์ รุ่งสะอาด
ปลัดเทศบาล
รักษาการแทนนายกเทศมนตรี
ต.ท่าทองใหม่',
'ભારતીય ટીમનો સુવર્ણ યુગ :
કિવીઝમાં પણ કમાલ',
   
'ཁམས་དཀར་མཛེས་ས་ཁུལ་དུ་རྒྱ་གཞུང་ལ་ཞི་བའི་ངོ་རྒོལ་',
'Χιόνια, βροχές και θυελλώδεις
άνεμοι συνθέτουν το',
'Հայաստանում սկսվել է դատական
համակարգի ձեւավորումը',
'რუსეთი ასევე გეგმავს
სამხედრო');
  print(phpversion() . "\n");
  foreach ($strs as $s) {
print("\n1: $s\n");
print('2: '. ($s = mb_strtoupper($s)) . "\n");
print('3'. ($s = mb_convert_case($s, MB_CASE_UPPER, "UTF-8")) . 
"\n");
print('4: '. ($s = mb_strtolower($s)) . "\n");
print('5: '. ($s = mb_convert_case($s, MB_CASE_LOWER, "UTF-8")) . 
"\n");
  }


./php -f test.php 
5.2.10-dev

1: Iñtërnâtiônàlizætiøn
2: IñTëRNâTIôNàLIZæTIøN
3IÑTËRNÂTIÔNÀLIZÆTIØN
4: i?t?rn?ti?n?liz?ti?n
5: itrntinliztin

1: החמאס: רוצים להשלים את עסקת שליט
במהירות האפשרית
2: החמאס: רוצים להשלים את עסקת שליט
במהירות האפשרית
3החמאס: רוצים להשלים את עסקת שליט
במהירות האפשרית
4: החמאס: רוצים להשלים את עסקת שליט
במהירות האפשרית
5: החמאס: רוצים להשלים את עסקת שליט
במהירות האפשרית

1: ايران لا ترى تغييرا في الموقف
الأمريكي
2: ايران لا ترى تغييرا في الموقف
الأمريكي
3ايران لا ترى تغييرا في الموقف
الأمريكي
4: ??  ??    ?
???
5:   

1: 独・米で死傷者を出した銃の乱射事件
2: Nj?Ã?DZ?Á?ƭ?ł?Ȁ?Â?Ň?Á?Á?Ɋ?Á?Ĺ?Ű?ĺ?Ļ?
3NjÃDZÁƬŁȀÂŇÁÁɊÁĹŰĹĻ
4: ?
5: 

1: 國會預算處公布驚人的赤字數據後
2: Ŝ?Ɯ?ɠ?Ǯ?ș?Ņ?Ÿ?ɩ?ĺ?ǚŭ?ƕ?Ɠ?ž?
3ŜƜƓǮȘŅŸƖĹǙ?ŬǶƓŽ
4: ???
5: ?

1: 이며 세계 경제 회복에 걸림돌이 되고 있다
2: ̝?˩? ̄?ʳ? ʲ?̠? ͚?˳?̗? ʱ?˦?ˏ?̝? ː?ʳ? ̞?ˋ?
3̝˩ ̄ʳ ʲ̠ ͚˳?̗ ʱ˦ˏ̝ ːʳ ̞ˋ
4: ?? ?? ??   ?? ??
5:?   

1: В дагестанском лесном массиве южнее
села Какашура
2: В даг??станском л??сном массив?? южн
с??ла Какашура
3В ДАГ?СТАНСКОМ Л?СНОМ МАССИВ? ЮЖН?? С?ЛА
КАКАШУРА
4: ?  ?? ??? ?  
5:  ? ? ? ?? ? 

1: นายประสิทธิ์ รุ่งสะอาด
ปลัดเทศบาล
รักษาการแทนนายกเทศมนตรี
ต.ท่าทองใหม่
2:  ??? ??
 ?
 ???.??
3   ? .
4:? .
5:? .

1: ભારતીય ટીમનો સુવર્ણ યુગ :
કિવીઝમાં પણ કમાલ
2: ?? ??? ?? ? : ?
??? ?? 
3  ?  : ?  
4:   ?  : ?  
5:   ?  : ?  

1:
ཁམས་དཀར་མཛེས་ས་ཁུལ་དུ་རྒྱ་གཞུང་ལ་ཞི་བའི་ངོ་རྒོལ་
2: ???
???

#47599 [Opn->Fbk]: zend_atoi() needs change for 64-bit support

2009-05-04 Thread jani
 ID:   47599
 Updated by:   j...@php.net
 Reported By:  Bjorn dot Wiberg at its dot uu dot se
-Status:   Open
+Status:   Feedback
 Bug Type: Scripting Engine problem
 Operating System: *
 PHP Version:  5.2.9
 New Comment:

Please try using this CVS snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/




Previous Comments:


[2009-03-08 16:01:09] Bjorn dot Wiberg at its dot uu dot se

Description:

External sources
(http://turin.nss.udel.edu/wiki/dropbox/doku.php?id=documentation:large-files)
indicate that zend_atoi() does not handle very large values correctly.

External source supplies proposed fix (change to
Zend/zend_operators.c).


Reproduce code:
---
Setting post_max_size 1M or upload_max_filesize 1M in php.ini.

Expected result:

Correct handling of very large memory values, e.g. "1M".

Actual result:
--
Limit maxes out at max value of 32 bits instead of specified value.





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



#47599 [Fbk]: zend_atoi() needs change for 64-bit support

2009-05-04 Thread jani
 ID:   47599
 Updated by:   j...@php.net
 Reported By:  Bjorn dot Wiberg at its dot uu dot se
 Status:   Feedback
 Bug Type: Scripting Engine problem
 Operating System: *
 PHP Version:  5.2.9
-Assigned To:  
+Assigned To:  fb-req-jani
 New Comment:

Also note that this is partially duplicate of bug #27792 (zend_atoi() 
has been replaced with zend_atol() in PHP_5_3)


Previous Comments:


[2009-05-04 18:47:55] j...@php.net

Please try using this CVS snapshot:

  http://snaps.php.net/php5.3-latest.tar.gz
 
For Windows:

  http://windows.php.net/snapshots/





[2009-03-08 16:01:09] Bjorn dot Wiberg at its dot uu dot se

Description:

External sources
(http://turin.nss.udel.edu/wiki/dropbox/doku.php?id=documentation:large-files)
indicate that zend_atoi() does not handle very large values correctly.

External source supplies proposed fix (change to
Zend/zend_operators.c).


Reproduce code:
---
Setting post_max_size 1M or upload_max_filesize 1M in php.ini.

Expected result:

Correct handling of very large memory values, e.g. "1M".

Actual result:
--
Limit maxes out at max value of 32 bits instead of specified value.





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



#47742 [Fbk->Opn]: mb_strtoupper and mb_strtolower failure cases

2009-05-04 Thread fsb at thefsb dot org
 ID:   47742
 User updated by:  fsb at thefsb dot org
 Reported By:  fsb at thefsb dot org
-Status:   Feedback
+Status:   Open
 Bug Type: mbstring related
 Operating System: os x
 PHP Version:  5.2.9
 Assigned To:  fb-req-jani
 New Comment:



 ./php -f test2.php 
5.2.10-dev
1: 이며 세계
2: ̝?˩? ̄?ʳ?
3̝˩ ̄ʳ
4: ?? ??
5:  

expected output:
1: 이며 세계
2: 이며 세계
3: 이며 세계
4: 이며 세계
5: 이며 세계


Previous Comments:


[2009-05-04 18:46:54] j...@php.net

Please provide a bit shorter example script. Or does the bug only
appear 
with such long strings..?



[2009-05-04 17:00:15] fsb at thefsb dot org

in php5.2-200904162030, mb_strto(upp|low)er appears to be even worse. 
mb_convert_case is now also badly broken.

  $strs = array(
'Iñtërnâtiônàlizætiøn',
'החמאס: רוצים להשלים את עסקת שליט
במהירות האפשרית',
'ايران لا ترى تغييرا في الموقف
الأمريكي',
'独・米で死傷者を出した銃の乱射事件',
'國會預算處公布驚人的赤字數據後',
'이며 세계 경제 회복에 걸림돌이 되고 있다',
'В дагестанском лесном массиве южнее
села Какашура',
'นายประสิทธิ์ รุ่งสะอาด
ปลัดเทศบาล
รักษาการแทนนายกเทศมนตรี
ต.ท่าทองใหม่',
'ભારતીય ટીમનો સુવર્ણ યુગ :
કિવીઝમાં પણ કમાલ',
   
'ཁམས་དཀར་མཛེས་ས་ཁུལ་དུ་རྒྱ་གཞུང་ལ་ཞི་བའི་ངོ་རྒོལ་',
'Χιόνια, βροχές και θυελλώδεις
άνεμοι συνθέτουν το',
'Հայաստանում սկսվել է դատական
համակարգի ձեւավորումը',
'რუსეთი ასევე გეგმავს
სამხედრო');
  print(phpversion() . "\n");
  foreach ($strs as $s) {
print("\n1: $s\n");
print('2: '. ($s = mb_strtoupper($s)) . "\n");
print('3'. ($s = mb_convert_case($s, MB_CASE_UPPER, "UTF-8")) . 
"\n");
print('4: '. ($s = mb_strtolower($s)) . "\n");
print('5: '. ($s = mb_convert_case($s, MB_CASE_LOWER, "UTF-8")) . 
"\n");
  }


./php -f test.php 
5.2.10-dev

1: Iñtërnâtiônàlizætiøn
2: IñTëRNâTIôNàLIZæTIøN
3IÑTËRNÂTIÔNÀLIZÆTIØN
4: i?t?rn?ti?n?liz?ti?n
5: itrntinliztin

1: החמאס: רוצים להשלים את עסקת שליט
במהירות האפשרית
2: החמאס: רוצים להשלים את עסקת שליט
במהירות האפשרית
3החמאס: רוצים להשלים את עסקת שליט
במהירות האפשרית
4: החמאס: רוצים להשלים את עסקת שליט
במהירות האפשרית
5: החמאס: רוצים להשלים את עסקת שליט
במהירות האפשרית

1: ايران لا ترى تغييرا في الموقف
الأمريكي
2: ايران لا ترى تغييرا في الموقف
الأمريكي
3ايران لا ترى تغييرا في الموقف
الأمريكي
4: ??  ??    ?
???
5:   

1: 独・米で死傷者を出した銃の乱射事件
2: Nj?Ã?DZ?Á?ƭ?ł?Ȁ?Â?Ň?Á?Á?Ɋ?Á?Ĺ?Ű?ĺ?Ļ?
3NjÃDZÁƬŁȀÂŇÁÁɊÁĹŰĹĻ
4: ?
5: 

1: 國會預算處公布驚人的赤字數據後
2: Ŝ?Ɯ?ɠ?Ǯ?ș?Ņ?Ÿ?ɩ?ĺ?ǚŭ?ƕ?Ɠ?ž?
3ŜƜƓǮȘŅŸƖĹǙ?ŬǶƓŽ
4: ???
5: ?

1: 이며 세계 경제 회복에 걸림돌이 되고 있다
2: ̝?˩? ̄?ʳ? ʲ?̠? ͚?˳?̗? ʱ?˦?ˏ?̝? ː?ʳ? ̞?ˋ?
3̝˩ ̄ʳ ʲ̠ ͚˳?̗ ʱ˦ˏ̝ ːʳ ̞ˋ
4: ?? ?? ??   ?? ??
5:?   

1: В дагестанском лесном массиве южнее
села Какашура
2: В даг??станском л??сном массив?? южн
с??ла Какашура
3В ДАГ?СТАНСКОМ Л?СНОМ МАССИВ? ЮЖН?? С?ЛА
КАКАШУРА
4: ?  ?? ??? ?  
5:  ? ? ? ?? ? 

1: นายประสิทธิ์ รุ่งสะอาด
ปลัดเทศบาล
รักษาการแทนนายกเทศมนตรี
ต.ท่าทองใหม่
2:  ??? ??
 ?
 ???.??
3   ? .
4:? .
5:? .

1: ભારતીય ટીમનો સુવર્ણ યુગ :
કિવીઝમાં પણ કમાલ
2: ?? ??? ?? ? : ?

#47525 [Bgs]: value returned from __call copied prematurely

2009-05-04 Thread rodricg at sellingsource dot com
 ID:   47525
 User updated by:  rodricg at sellingsource dot com
 Reported By:  rodricg at sellingsource dot com
 Status:   Bogus
 Bug Type: Scripting Engine problem
 Operating System: linux
 PHP Version:  5.2.9
 New Comment:

IMHO __call is breaking copy-on-write semantics.  At the very least it
could be said that memory utilization with __call is less efficient than
without it.  Despite setting of USE_ZEND_ALLOC.

USE_ZEND_ALLOC=1 valgrind php -n -d memory_limit=1024M b.php 100
getStr
malloc/free: 15,018 allocs, 13,296 frees, 4,253,597 bytes allocated.

USE_ZEND_ALLOC=1 valgrind php -n -d memory_limit=1024M b.php 100 magic
malloc/free: 15,118 allocs, 13,396 frees, 109,111,199 bytes allocated.

USE_ZEND_ALLOC=0 valgrind php -n -d memory_limit=1024M b.php 100
getStr
malloc/free: 18,181 allocs, 16,459 frees, 4,407,683 bytes allocated.

USE_ZEND_ALLOC=0 valgrind php -n -d memory_limit=1024M b.php 100 magic
malloc/free: 18,981 allocs, 17,259 frees, 104,439,576 bytes allocated.

http://bugs.pastebin.com/f754ba8cd


Previous Comments:


[2009-05-02 03:01:24] j...@php.net

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

This is a side-effect of the Zend memory manager. If you run the script

with PHP build with --enable-debug and like this:

# USE_ZEND_ALLOC=0 php test.php
new A(): 8,280
$a->str: 8,280
$a->getStr(): 8,280
$a->magic(): 8,280

You see that there is no leak or unnecessary "copying" anywhere.



[2009-02-28 01:56:43] rodricg at sellingsource dot com

Description:

Values returned from the magic __call method are copied immediately 
resulting in increased memory usage.

Reproduce code:
---
str = str_repeat("a",
100); }
public function __call($m, $a) {return $this->str;}
public function getStr() {return $this->str;}
}

$a = new A(); mem('new A()');
$b = $a->str; mem('$a->str');
$c = $a->getStr(); mem('$a->getStr()');
$d = $a->magic(); mem('$a->magic()');

?>

Expected result:

new A(): 1,310,720
$a->str: 1,310,720
$a->getStr(): 1,310,720
$a->magic(): 1,310,720

Actual result:
--
new A(): 1,310,720
$a->str: 1,310,720
$a->getStr(): 1,310,720
$a->magic(): 2,359,296





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



#48149 [NEW]: Cannot make interval parts larger than 9999.

2009-05-04 Thread lists at reptiliannature dot org
From: lists at reptiliannature dot org
Operating system: ALL
PHP version:  5.3.0RC1
PHP Bug Type: Date/time related
Bug description:  Cannot make interval parts larger than .

Description:

This bug seems to be identical to http://bugs.php.net/bug.php?id=45545
which was marked closed.

It appears than when part of the interval is greater than  the
DateInterval throws an exception.

DateInterval::__construct(): Unknown or bad format (PT1M);

This happens with years, days, hours, minutes, and seconds

Reproduce code:
---
$i = 900;
while ($i) {
try {
$di = new DateInterval('PT' . $i . 'M');
}
catch (exception $e) {
var_dump($i);
echo $e->getMessage();
break;
}
$i++;
}

Expected result:

I would expect to have a DateInterval object with interval ('PT1000M') or
greater.

Actual result:
--
DateInterval::__construct(): Unknown or bad format (PT1M);

-- 
Edit bug report at http://bugs.php.net/?id=48149&edit=1
-- 
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=48149&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=48149&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=48149&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=48149&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=48149&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=48149&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=48149&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=48149&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=48149&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=48149&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=48149&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=48149&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=48149&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=48149&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=48149&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=48149&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=48149&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=48149&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=48149&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=48149&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=48149&r=mysqlcfg



#47993 [NoF->Opn]: htmlentities, htmlspecialchars warnings don't appear on apache 1.3.33

2009-05-04 Thread mariusads at helpedia dot com
 ID:   47993
 User updated by:  mariusads at helpedia dot com
 Reported By:  mariusads at helpedia dot com
-Status:   No Feedback
+Status:   Open
 Bug Type: Apache related
 Operating System: Windows 2003 Web Edition
 PHP Version:  5.2.9
 New Comment:

I've provided all the information I think it's needed so it shouldn't
be closed but investigated.


Previous Comments:


[2009-04-24 01:00:01] 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".



[2009-04-17 21:56:03] mariusads at helpedia dot com

I've done further tests on the Apache 1.3.33 version.

With or without php.ini present in c:\windows the error is not
reported.
I've also tried with PHP 5.2.5 and it's also not reported, with or
without php.ini present.

i've added a trigger_error() call right above the calls to
htmlspecialchars or htmlentities and those notices appear in the PHP
error log but NOT in the apache error log (configuration option for a
virtualhost in httpd.conf).
The warnings for date function usage (when I enabled E_STRICT) appear
in both error logs.



[2009-04-17 21:36:39] mariusads at helpedia dot com

Yes, both servers have:

D:\php>php -v
PHP 5.2.9-2 (cli) (built: Apr  9 2009 08:23:19)

downloaded the same day from the php site.

php.ini derived from php.ini-recommended with minor changes such as
setting the smtp mail server.
I don't have any problems uploading the php.ini files somewhere if you
guys think it's needed.

Here are the phpinfo dumps, as much as I'm comfortable showing:

http://94.75.244.244/apache1.txt
http://94.75.244.244/apache2.txt

the only important diffs seem to be that i have mhash gettext and
mysqli enabled on the Apache 1.3.3 version. I tested with and without
gettext and the same, no warnings are shown on 1.3.33



[2009-04-16 19:30:55] j...@php.net

Is the same php.ini used by both apache1 and 2? Are both running 
exactly same PHP version? (check all these from phpinfo() output from 
each server!)



[2009-04-16 18:46:35] mariusads at helpedia dot com

Description:

PHP 5.2.9-2 (cli) (built: Apr  9 2009 08:23:19)

htmlspecialchars and htmlentities return empty strings when the text
passed to them is not correct in the format you tell it, this is known.

The problem I see is that the with an identical PHP.INI file, the
following warnings are showing in logs when used with Apache 2.0.63 but
don't appear when used with Apache 1.3.33 (and probably other 1.3.xx):

[Thu Apr 16 20:12:53 2009] [error] [client x.x.x.x] PHP Warning: 
htmlspecialchars() [function.htmlspecialchars]: Invalid
multibyte sequence in argument in D:\\website\\file.php on line 83

[Thu Apr 16 19:38:28 2009] [error] [client x.x.x.x] PHP Warning: 
htmlentities() [function.htmlentities]: Invalid
multibyte sequence in argument in D:\\website\\file.php on line 83

These warnings appear on Apache 2.0.63, they don't appear on Apache
1.3.33

The INI is configured with error_reporting E_ALL (phpinfo shows
error_reporting => 6143 => 6143) and even with E_ALL|E_STRICT the Apache
1.3.33 version doesn't show the warnings but does show recommendations
about the date function and timezone settings so the error log clearly
works.


Reproduce code:
---
Download the following NFO file: http://www.tgdb.net/temp/test.nfo

Save it in the same folder where you'll run the following code:



The NFO file above contains ASCII art done with characters with ascii
code above 0x7F so it's an invalid UTF-8, therefore the functions will
both fail returning an empty string. 

That's not the point here - though it's arguable if it's the best
solution instead of just ignoring bad unicode chars - please continue
reading

The problem is I want to receive a warning, so that I'll be able to use
error_get_last() and pass the text through a filter before trying to
echo it again. 

In my case it's not possible to pre-filter all nfo files because some
contain valid UTF-8 code and no ASCII art, others have only ASCII art.


Expected result:

I should see warning messages in the logs no matter the Apache version.

Actual result:
--
On Apache 1.3.33, no warnings are shown when htmlentities and
htmlspecialchars receive invalid text. 





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



#48136 [Bgs]: Empty session id causes a warning

2009-05-04 Thread dont dot want at spam dot no
 ID:   48136
 User updated by:  dont dot want at spam dot no
 Reported By:  dont dot want at spam dot no
 Status:   Bogus
 Bug Type: Session related
 Operating System: Win XP SP2
 PHP Version:  5.2.9
 New Comment:

I'm quite familiar with the manual, but haven't been able to find a
page that mentions that session_start() may give a warning if the user
sets the session id to an empty string.

And in any case, the PHP warning message is not accurate. An empty
string is not "illegal characters"; it's illegal input perhaps but there
aren't any characters.


Previous Comments:


[2009-05-04 12:40:06] il...@php.net

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.



[2009-05-03 14:26:14] dont dot want at spam dot no

Description:

If session cookie is an empty string, PHP gives the following warning:
"Warning:  session_start() [function.session-start]: The session id
contains illegal characters, valid characters are a-z, A-Z, 0-9 and
'-,'".

Worst case scenario: If the user sets the session id to an empty string
manually in their browser and php errors are displayed, the page will
break (could not start session, headers already sent by warning message,
etc.).

Normal scenario: display_errors is disabled, so this will only clutter
the error log with an unnecessary warning.

In my case I have session.use_only_cookies enabled and I work around
the issue with the following code:


Reproduce code:
---
I used jQuery with a cookie addon to set the cookie to an empty string
(was actually trying to delete the cookie), but the same could be
simulated with the following 2 lines of PHP:



You also get the same using GET (eg. "localhost/index.php?PHPSESSID=",
remember to delete any old cookies before trying this or it won't work)




Expected result:

No warning since session ID is empty and PHP should be smart enough to
realise that this means that the session id has not been generated yet.

Actual result:
--
Warning: session_start() [function.session-start]: The session id
contains illegal characters, valid characters are a-z, A-Z, 0-9 and '-,'
in F:\htdocs\index.php on line 9





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



#48149 [Opn->Ver]: Cannot make interval parts larger than 9999.

2009-05-04 Thread fa
 ID:   48149
 Updated by:   f...@php.net
 Reported By:  lists at reptiliannature dot org
-Status:   Open
+Status:   Verified
 Bug Type: Date/time related
 Operating System: ALL
 PHP Version:  5.3.0RC1
 New Comment:

Still present in 5.3.0RC2


Previous Comments:


[2009-05-04 21:20:13] lists at reptiliannature dot org

Description:

This bug seems to be identical to http://bugs.php.net/bug.php?id=45545
which was marked closed.

It appears than when part of the interval is greater than  the
DateInterval throws an exception.

DateInterval::__construct(): Unknown or bad format (PT1M);

This happens with years, days, hours, minutes, and seconds

Reproduce code:
---
$i = 900;
while ($i) {
try {
$di = new DateInterval('PT' . $i . 'M');
}
catch (exception $e) {
var_dump($i);
echo $e->getMessage();
break;
}
$i++;
}

Expected result:

I would expect to have a DateInterval object with interval ('PT1000M')
or greater.

Actual result:
--
DateInterval::__construct(): Unknown or bad format (PT1M);





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



#44791 [Ana->Bgs]: pg_execute() works with boolean params and "true" but not with "false"

2009-05-04 Thread mbeccati
 ID:   44791
 Updated by:   mbecc...@php.net
 Reported By:  php at benjaminschulz dot com
-Status:   Analyzed
+Status:   Bogus
 Bug Type: Feature/Change Request
 Operating System: osx
 PHP Version:  5.3CVS-2008-04-21 (CVS)
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

I think the behaviour is exactly what I would expect. PostrgeSQL
booleans are "t" and "f". Recent PgSQL versions also accept 1 and 0 as
input for booleans, but not the empty string, which is what PHP outputs
for a bool(false).

The pgsql PHP extension wasn't written with portability in mind, so it
expects users to have knowledge of how PostgreSQL works. In this
specific case, prepare/execute don't do any type of magic and just cast
the parameters to string.

Your example should in fact look like:
$result = pg_execute($dbconn, "my_query", array('t'));
$result = pg_execute($dbconn, "my_query", array('f'));

I've been pointed to this bug by Pierre and discussed with him about
it.


Previous Comments:


[2008-04-21 09:35:55] php at benjaminschulz dot com

This applies to pg_send_execute, too.



[2008-04-21 09:32:58] paj...@php.net

The problem is due to the way the casting is done internally:

  SEPARATE_ZVAL(tmp);
  convert_to_string_ex(tmp);
  if (Z_TYPE_PP(tmp) != IS_STRING) {
php_error_docref(NULL TSRMLS_CC, E_WARNING,"Error converting
parameter");
_php_pgsql_free_params(params, num_params);
RETURN_FALSE;
  }

It could be improved by testing the variable type prior to convert.
However I'm not sure if it is desired or if it has some bad side effects
like BC breaks.



[2008-04-21 09:14:38] php at benjaminschulz dot com

Description:

Binding a boolean "false" to a statement doesn't work.

Reproduce code:
---
$result = pg_prepare($dbconn, "my_query", 'SELECT * FROM test WHERE
boolfield = $1');
$result = pg_execute($dbconn, "my_query", array(true)); // works
$result = pg_execute($dbconn, "my_query", array(false)); // triggers an
error

Expected result:

No error ;)


Actual result:
--
Warning: pg_execute(): Query failed: ERROR:  invalid input syntax for
type boolean: "" in ...





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



#48125 [Bgs]: php-cli makes "less" command behave differently

2009-05-04 Thread scot at wilcoxon dot org
 ID:   48125
 User updated by:  scot at wilcoxon dot org
 Reported By:  scot at wilcoxon dot org
 Status:   Bogus
 Bug Type: Unknown/Other Function
 Operating System: Linux Ubuntu 9.04
 PHP Version:  5.2.9
 New Comment:

Documentation is needed of the option which makes php be compatible
with pipes.  I suspect Readline is performing initialization of the
terminal despite no input being performed.  The --interactive option
probably forces such behavior, but the man page did not indicate the
opposite of --interactive (--nointeractive did not change the problem).


Previous Comments:


[2009-05-01 17:13:10] j...@php.net

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.





[2009-04-30 20:57:46] scot at wilcoxon dot org

Description:

When php-cli is sending output to "less" it becomes necessary to press
ENTER after commands.  It happens both locally and through SSH.

Reproduce code:
---
---
>From manual page: features.commandline
---
php -r 'print_r(get_defined_constants());' | less

Expected result:

Output from command with ":" at bottom.  Pressing "n" should start a
new page.

Actual result:
--
Output from command with ":" at bottom.  Pressing "n" does nothing
until ENTER is pressed.





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



#45092 [Opn->Tbd]: header HTTP context option not being used (--with-curlwrappers)

2009-05-04 Thread jani
 ID:   45092
 Updated by:   j...@php.net
 Reported By:  nweibley at gmail dot com
-Status:   Open
+Status:   To be documented
-Bug Type: cURL related
+Bug Type: Streams related
 Operating System: Linux (Gentoo)
 PHP Version:  5.2.6
 New Comment:

As of PHP 5.9.10 you can pass either string or array (simple array, not

any key => value pairs!) regardless if you used --with-curlwrappers 
option or not.


Previous Comments:


[2008-05-26 15:34:59] nweibley at gmail dot com

Ah, came to the solution.

Line 332 of ext/curl/streams.c:
if (Z_TYPE_PP(header) == IS_STRING) {

Ergo, each element of the array passed as the value of the 'header'
context option *must* be a string, not an associative key=>value pair.
I'd propose this be more clearly documented or an additional conditional
branch be added to ext/curl/streams.c to handle key=>value array pairs
and especially a simple string as the header context option.

This is the behavior when --with-curlwrappers is not used, and it seems
highly logical that it would still stand with curlwrappers enabled.



[2008-05-26 15:27:37] nweibley at gmail dot com

Since line 324 of ext/curl/streams.c reads:
if (SUCCESS == php_stream_context_get_option(context, "http", "header",
&ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_ARRAY) {

I have changed my code to reflect passing an array as the value of
'header' in the context options. The problem still persists, however.



[2008-05-26 15:16:09] nweibley at gmail dot com

Description:

Pretty simple; I'm trying to create a stream context which will send
custom headers along with a simple HTTP GET request. It wasn't working
so I created a second debug script to see what was up and found that PHP
simply isn't including any of my custom headers. 

This *is not* a duplicate of bug #41051, I have tried that as well.

Reproduce code:
---
 array('method' => 'GET','header' => "Custom:
woot"));
 $ctx = stream_context_create($params);
 $fp = fopen('http://localhost/recv.php', 'r', false, $ctx);
 print_r(stream_context_get_options($ctx));
 print_r(stream_get_meta_data($fp));
 echo stream_get_contents($fp);
?>



Expected result:

Array
(
[http] => Array
(
[method] => GET
[header] => Custom: woot
)

)
Array
(
[wrapper_data] => Array
(
[headers] => Array
(
)

[readbuf] => Resource id #4
)

[wrapper_type] => cURL
[stream_type] => cURL
[mode] => r
[unread_bytes] => 0
[seekable] => 
[uri] => http://localhost/404.php
[timed_out] => 
[blocked] => 1
[eof] => 
)
Array
(
[User-Agent] => PHP/5.2.6-pl1-gentoo
[Host] => localhost
[Accept] => */*
[Custom] => woot
)

Actual result:
--
Array
(
[http] => Array
(
[method] => GET
[header] => Custom: woot
)

)
Array
(
[wrapper_data] => Array
(
[headers] => Array
(
)

[readbuf] => Resource id #4
)

[wrapper_type] => cURL
[stream_type] => cURL
[mode] => r
[unread_bytes] => 0
[seekable] => 
[uri] => http://localhost/recv.php
[timed_out] => 
[blocked] => 1
[eof] => 
)
Array
(
[User-Agent] => PHP/5.2.6-pl1-gentoo
[Host] => localhost
[Accept] => */*
)





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



#47773 [Ver->Bgs]: cURL multi crashes

2009-05-04 Thread jani
 ID:   47773
 Updated by:   j...@php.net
 Reported By:  entpman at gmail dot com
-Status:   Verified
+Status:   Bogus
 Bug Type: cURL related
 Operating System: *
 PHP Version:  5.2.9
 Assigned To:  pajoye
 New Comment:

Bugs in libcurl are not bugs in PHP. :) (see above comment and link)


Previous Comments:


[2009-04-06 20:45:05] daniel at haxx dot se

I'm convinced this is a bug in libcurl, see this analysis by 
Sergii Volchkov:

http://curl.haxx.se/mail/lib-2009-04/0028.html

(AFAIK, there is nobody working on a fix for this.)



[2009-03-25 14:08:06] entpman at gmail dot com

Description:

The program will work fine for hundreds of downloads then suddenly
crashes.

Reproduce code:
---
 'http://www.google.com'
),
array(
'url' => 'http://www.yahoo.com'
)
)
);

// of course more urls are needs

function downloadurls($downloads,$cookie = null){   
$timeout = 30;  
$mcurl = curl_multi_init();
$agent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.12)
Gecko/2009201 Firefox/3.0.0.1";

foreach($downloads as $key=>$download){ 
$url = $download['url'];
$ch = curl_init();   
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
if(!empty($download['postdata'])){
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS,$download['postdata']); 
}   
if(!empty($cookie)){
@unlink($cookie);
//echo "added cookie\n";
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
}
if(!empty($download['proxy'])){
curl_setopt($ch, CURLOPT_PROXY, $download['proxy']);
}
curl_multi_add_handle($mcurl, $ch);
$downloads[$key]['handle'] = $ch;   
}

do {
$n=curl_multi_exec($mcurl,$active);
usleep(100);
}   
while ($active);

foreach($downloads as $key=>$download){ 
$ch = $download['handle'];
$done_content = curl_multi_getcontent($ch);
if(curl_errno($ch) == 0) {
$downloads[$key]['picture'] = $done_content;
} else {
exit('error');  
}
curl_multi_remove_handle($mcurl, $ch);
curl_close($ch);   
}

curl_multi_close($mcurl);
return $downloads;
}
?>

Actual result:
--
backtrace:

php_curl.dll!_Curl_llist_insert_next()  + 0x48 bytes
php_curl.dll!_Curl_hash_add()  + 0x74 bytes 
php_curl.dll!_Curl_cache_addr()  + 0x6d bytes   
php_curl.dll!_Curl_addrinfo4_callback()  + 0x82 bytes   
php_curl.dll!_Curl_addrinfo4_callback()  + 0x14 bytes   
php_curl.dll!_Curl_getaddrinfo()  + 0x317 bytes 
msvcrt.dll!77c3a3b0()   
[Frames below may be incorrect and/or missing, no symbols loaded for
msvcrt.dll] 
kernel32.dll!7c80b683() 





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



#45092 [Tbd]: header HTTP context option not being used (--with-curlwrappers)

2009-05-04 Thread nweibley at gmail dot com
 ID:   45092
 User updated by:  nweibley at gmail dot com
 Reported By:  nweibley at gmail dot com
 Status:   To be documented
 Bug Type: Streams related
 Operating System: Linux (Gentoo)
 PHP Version:  5.2.6
 New Comment:

Thanks for the update!


Previous Comments:


[2009-05-05 00:34:47] j...@php.net

As of PHP 5.9.10 you can pass either string or array (simple array, not

any key => value pairs!) regardless if you used --with-curlwrappers 
option or not.



[2008-05-26 15:34:59] nweibley at gmail dot com

Ah, came to the solution.

Line 332 of ext/curl/streams.c:
if (Z_TYPE_PP(header) == IS_STRING) {

Ergo, each element of the array passed as the value of the 'header'
context option *must* be a string, not an associative key=>value pair.
I'd propose this be more clearly documented or an additional conditional
branch be added to ext/curl/streams.c to handle key=>value array pairs
and especially a simple string as the header context option.

This is the behavior when --with-curlwrappers is not used, and it seems
highly logical that it would still stand with curlwrappers enabled.



[2008-05-26 15:27:37] nweibley at gmail dot com

Since line 324 of ext/curl/streams.c reads:
if (SUCCESS == php_stream_context_get_option(context, "http", "header",
&ctx_opt) && Z_TYPE_PP(ctx_opt) == IS_ARRAY) {

I have changed my code to reflect passing an array as the value of
'header' in the context options. The problem still persists, however.



[2008-05-26 15:16:09] nweibley at gmail dot com

Description:

Pretty simple; I'm trying to create a stream context which will send
custom headers along with a simple HTTP GET request. It wasn't working
so I created a second debug script to see what was up and found that PHP
simply isn't including any of my custom headers. 

This *is not* a duplicate of bug #41051, I have tried that as well.

Reproduce code:
---
 array('method' => 'GET','header' => "Custom:
woot"));
 $ctx = stream_context_create($params);
 $fp = fopen('http://localhost/recv.php', 'r', false, $ctx);
 print_r(stream_context_get_options($ctx));
 print_r(stream_get_meta_data($fp));
 echo stream_get_contents($fp);
?>



Expected result:

Array
(
[http] => Array
(
[method] => GET
[header] => Custom: woot
)

)
Array
(
[wrapper_data] => Array
(
[headers] => Array
(
)

[readbuf] => Resource id #4
)

[wrapper_type] => cURL
[stream_type] => cURL
[mode] => r
[unread_bytes] => 0
[seekable] => 
[uri] => http://localhost/404.php
[timed_out] => 
[blocked] => 1
[eof] => 
)
Array
(
[User-Agent] => PHP/5.2.6-pl1-gentoo
[Host] => localhost
[Accept] => */*
[Custom] => woot
)

Actual result:
--
Array
(
[http] => Array
(
[method] => GET
[header] => Custom: woot
)

)
Array
(
[wrapper_data] => Array
(
[headers] => Array
(
)

[readbuf] => Resource id #4
)

[wrapper_type] => cURL
[stream_type] => cURL
[mode] => r
[unread_bytes] => 0
[seekable] => 
[uri] => http://localhost/recv.php
[timed_out] => 
[blocked] => 1
[eof] => 
)
Array
(
[User-Agent] => PHP/5.2.6-pl1-gentoo
[Host] => localhost
[Accept] => */*
)





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



#47993 [Opn->Fbk]: htmlentities, htmlspecialchars warnings don't appear on apache 1.3.33

2009-05-04 Thread jani
 ID:   47993
 Updated by:   j...@php.net
 Reported By:  mariusads at helpedia dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Apache related
 Operating System: Windows 2003 Web Edition
 PHP Version:  5.2.9
 New Comment:

Do you have any php settings done in your httpd.conf (or some file it 
includes)? Check for them. Check the phpinfo() output in same script
you 
don't get the errors with.


Previous Comments:


[2009-04-17 21:56:03] mariusads at helpedia dot com

I've done further tests on the Apache 1.3.33 version.

With or without php.ini present in c:\windows the error is not
reported.
I've also tried with PHP 5.2.5 and it's also not reported, with or
without php.ini present.

i've added a trigger_error() call right above the calls to
htmlspecialchars or htmlentities and those notices appear in the PHP
error log but NOT in the apache error log (configuration option for a
virtualhost in httpd.conf).
The warnings for date function usage (when I enabled E_STRICT) appear
in both error logs.



[2009-04-17 21:36:39] mariusads at helpedia dot com

Yes, both servers have:

D:\php>php -v
PHP 5.2.9-2 (cli) (built: Apr  9 2009 08:23:19)

downloaded the same day from the php site.

php.ini derived from php.ini-recommended with minor changes such as
setting the smtp mail server.
I don't have any problems uploading the php.ini files somewhere if you
guys think it's needed.

Here are the phpinfo dumps, as much as I'm comfortable showing:

http://94.75.244.244/apache1.txt
http://94.75.244.244/apache2.txt

the only important diffs seem to be that i have mhash gettext and
mysqli enabled on the Apache 1.3.3 version. I tested with and without
gettext and the same, no warnings are shown on 1.3.33



[2009-04-16 19:30:55] j...@php.net

Is the same php.ini used by both apache1 and 2? Are both running 
exactly same PHP version? (check all these from phpinfo() output from 
each server!)



[2009-04-16 18:46:35] mariusads at helpedia dot com

Description:

PHP 5.2.9-2 (cli) (built: Apr  9 2009 08:23:19)

htmlspecialchars and htmlentities return empty strings when the text
passed to them is not correct in the format you tell it, this is known.

The problem I see is that the with an identical PHP.INI file, the
following warnings are showing in logs when used with Apache 2.0.63 but
don't appear when used with Apache 1.3.33 (and probably other 1.3.xx):

[Thu Apr 16 20:12:53 2009] [error] [client x.x.x.x] PHP Warning: 
htmlspecialchars() [function.htmlspecialchars]: Invalid
multibyte sequence in argument in D:\\website\\file.php on line 83

[Thu Apr 16 19:38:28 2009] [error] [client x.x.x.x] PHP Warning: 
htmlentities() [function.htmlentities]: Invalid
multibyte sequence in argument in D:\\website\\file.php on line 83

These warnings appear on Apache 2.0.63, they don't appear on Apache
1.3.33

The INI is configured with error_reporting E_ALL (phpinfo shows
error_reporting => 6143 => 6143) and even with E_ALL|E_STRICT the Apache
1.3.33 version doesn't show the warnings but does show recommendations
about the date function and timezone settings so the error log clearly
works.


Reproduce code:
---
Download the following NFO file: http://www.tgdb.net/temp/test.nfo

Save it in the same folder where you'll run the following code:



The NFO file above contains ASCII art done with characters with ascii
code above 0x7F so it's an invalid UTF-8, therefore the functions will
both fail returning an empty string. 

That's not the point here - though it's arguable if it's the best
solution instead of just ignoring bad unicode chars - please continue
reading

The problem is I want to receive a warning, so that I'll be able to use
error_get_last() and pass the text through a filter before trying to
echo it again. 

In my case it's not possible to pre-filter all nfo files because some
contain valid UTF-8 code and no ASCII art, others have only ASCII art.


Expected result:

I should see warning messages in the logs no matter the Apache version.

Actual result:
--
On Apache 1.3.33, no warnings are shown when htmlentities and
htmlspecialchars receive invalid text. 





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



#47742 [Opn->Fbk]: mb_strtoupper and mb_strtolower failure cases

2009-05-04 Thread jani
 ID:   47742
 Updated by:   j...@php.net
 Reported By:  fsb at thefsb dot org
-Status:   Open
+Status:   Feedback
 Bug Type: mbstring related
 Operating System: os x
 PHP Version:  5.2.9
 Assigned To:  fb-req-jani
 New Comment:

One last question: What is the charset you used? I don't see any greek

chars anywhere.. ;)


Previous Comments:


[2009-05-04 19:02:43] fsb at thefsb dot org



 ./php -f test2.php 
5.2.10-dev
1: 이며 세계
2: ̝?˩? ̄?ʳ?
3̝˩ ̄ʳ
4: ?? ??
5:  

expected output:
1: 이며 세계
2: 이며 세계
3: 이며 세계
4: 이며 세계
5: 이며 세계



[2009-05-04 18:46:54] j...@php.net

Please provide a bit shorter example script. Or does the bug only
appear 
with such long strings..?



[2009-05-04 17:00:15] fsb at thefsb dot org

in php5.2-200904162030, mb_strto(upp|low)er appears to be even worse. 
mb_convert_case is now also badly broken.

  $strs = array(
'Iñtërnâtiônàlizætiøn',
'החמאס: רוצים להשלים את עסקת שליט
במהירות האפשרית',
'ايران لا ترى تغييرا في الموقف
الأمريكي',
'独・米で死傷者を出した銃の乱射事件',
'國會預算處公布驚人的赤字數據後',
'이며 세계 경제 회복에 걸림돌이 되고 있다',
'В дагестанском лесном массиве южнее
села Какашура',
'นายประสิทธิ์ รุ่งสะอาด
ปลัดเทศบาล
รักษาการแทนนายกเทศมนตรี
ต.ท่าทองใหม่',
'ભારતીય ટીમનો સુવર્ણ યુગ :
કિવીઝમાં પણ કમાલ',
   
'ཁམས་དཀར་མཛེས་ས་ཁུལ་དུ་རྒྱ་གཞུང་ལ་ཞི་བའི་ངོ་རྒོལ་',
'Χιόνια, βροχές και θυελλώδεις
άνεμοι συνθέτουν το',
'Հայաստանում սկսվել է դատական
համակարգի ձեւավորումը',
'რუსეთი ასევე გეგმავს
სამხედრო');
  print(phpversion() . "\n");
  foreach ($strs as $s) {
print("\n1: $s\n");
print('2: '. ($s = mb_strtoupper($s)) . "\n");
print('3'. ($s = mb_convert_case($s, MB_CASE_UPPER, "UTF-8")) . 
"\n");
print('4: '. ($s = mb_strtolower($s)) . "\n");
print('5: '. ($s = mb_convert_case($s, MB_CASE_LOWER, "UTF-8")) . 
"\n");
  }


./php -f test.php 
5.2.10-dev

1: Iñtërnâtiônàlizætiøn
2: IñTëRNâTIôNàLIZæTIøN
3IÑTËRNÂTIÔNÀLIZÆTIØN
4: i?t?rn?ti?n?liz?ti?n
5: itrntinliztin

1: החמאס: רוצים להשלים את עסקת שליט
במהירות האפשרית
2: החמאס: רוצים להשלים את עסקת שליט
במהירות האפשרית
3החמאס: רוצים להשלים את עסקת שליט
במהירות האפשרית
4: החמאס: רוצים להשלים את עסקת שליט
במהירות האפשרית
5: החמאס: רוצים להשלים את עסקת שליט
במהירות האפשרית

1: ايران لا ترى تغييرا في الموقف
الأمريكي
2: ايران لا ترى تغييرا في الموقف
الأمريكي
3ايران لا ترى تغييرا في الموقف
الأمريكي
4: ??  ??    ?
???
5:   

1: 独・米で死傷者を出した銃の乱射事件
2: Nj?Ã?DZ?Á?ƭ?ł?Ȁ?Â?Ň?Á?Á?Ɋ?Á?Ĺ?Ű?ĺ?Ļ?
3NjÃDZÁƬŁȀÂŇÁÁɊÁĹŰĹĻ
4: ?
5: 

1: 國會預算處公布驚人的赤字數據後
2: Ŝ?Ɯ?ɠ?Ǯ?ș?Ņ?Ÿ?ɩ?ĺ?ǚŭ?ƕ?Ɠ?ž?
3ŜƜƓǮȘŅŸƖĹǙ?ŬǶƓŽ
4: ???
5: ?

1: 이며 세계 경제 회복에 걸림돌이 되고 있다
2: ̝?˩? ̄?ʳ? ʲ?̠? ͚?˳?̗? ʱ?˦?ˏ?̝? ː?ʳ? ̞?ˋ?
3̝˩ ̄ʳ ʲ̠ ͚˳?̗ ʱ˦ˏ̝ ːʳ ̞ˋ
4: ?? ?? ??   ?? ??
5:?   

1: В дагестанском лесном массиве южнее
села Какашура
2: В даг??станском л??сном массив?? южн
с??ла Какашура
3В ДАГ?СТАНСКОМ Л?СНОМ МАССИВ? ЮЖН?? С?ЛА
КАКАШУРА
4: ?  ?? ??? ?  
5:  ? ? ? ?? ? 

1: นายประสิทธิ์ รุ่งสะอาด
ปลัดเทศบาล
รักษาการแทนนายกเทศมนตรี
ต.ท่าทองใหม่
2:  ??? ??
 ?
 ???.??
3   ? .
4:

#48147 [Opn->Fbk]: iconv with //IGNORE cuts the string

2009-05-04 Thread jani
 ID:   48147
 Updated by:   j...@php.net
 Reported By:  kulakov74 at yandex dot ru
-Status:   Open
+Status:   Feedback
 Bug Type: ICONV related
 Operating System: Linux
 PHP Version:  5.2.6
 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.




Previous Comments:


[2009-05-04 14:52:10] kulakov74 at yandex dot ru

Description:

iconv() without //IGNORE as known cuts the string at the first illegal
character, but with //IGNORE it should not. Still, I get a truncated
text, but not at the point where the character is. Sorry the actual PHP
version is 5.2.6, but I cannot upgrade it. Just to let you know. Can you
test that with the last version? Please download the file from
http://www.oppcharts.com/iconv.html

Reproduce code:
---
$Body1=... //read the file

echo(strlen($Body1)."\n");
$Body2=iconv('UTF-8', 'ISO-8859-1', $Body1);
echo(strlen($Body2)."\n");

$Body2=iconv('UTF-8', 'ISO-8859-1//IGNORE', $Body1);
echo(strlen($Body2)."\n");



Expected result:

15323
Notice: iconv(): Detected an illegal character in input string in
/home/doldon/html/tdnam/dev.php on line 18
3588
---
15323
15321 - I can get this if I use //TRANSLIT or when I run the test on my
home Windows PHP 4


Actual result:
--
15323
Notice: iconv(): Detected an illegal character in input string in
/home/doldon/html/tdnam/dev.php on line 18
3588
---
15323
Notice: iconv(): Detected an illegal character in input string in
/home/doldon/html/tdnam/dev.php on line 18
8157 - THIS IS THE PROBLEM





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



#47507 [Fbk->Opn]: PHP Notice: iconv(): Wrong charset

2009-05-04 Thread aboh24 at gmx dot de
 ID:   47507
 User updated by:  aboh24 at gmx dot de
 Reported By:  aboh24 at gmx dot de
-Status:   Feedback
+Status:   Open
 Bug Type: ICONV related
 Operating System: Solaris 10 / 64-bit
 PHP Version:  5.2.8
 New Comment:

OK - I redo the compiling and then I run a make test. Attached the
iconv related lines:


TEST 1677/6171 [ext/iconv/tests/bug16069.phpt]^MSKIP Bug #16069 (ICONV
transliteration failure) [ext/iconv/tests/bug16069.phpt] reason: CP932
to EUC-JP translit not available
TEST 1678/6171 [ext/iconv/tests/bug37176.phpt]^MPASS Bug #37176
(iconv_strpos() fails to find a string) [ext/iconv/tests/bug37176.phpt]
TEST 1679/6171 [ext/iconv/tests/bug37773.phpt]^MPASS Bug #37773
(iconv_substr() gives "Unknown error" when string length = 1")
[ext/iconv/tests/bug37773.phpt]
TEST 1680/6171 [ext/iconv/tests/eucjp2iso2022jp.phpt]^MFAIL EUC-JP to
ISO-2022-JP [ext/iconv/tests/eucjp2iso2022jp.phpt]
TEST 1681/6171 [ext/iconv/tests/eucjp2sjis.phpt]^MFAIL EUC-JP to SJIS
[ext/iconv/tests/eucjp2sjis.phpt]
TEST 1682/6171 [ext/iconv/tests/eucjp2utf8.phpt]^MPASS EUC-JP to UTF8
[ext/iconv/tests/eucjp2utf8.phpt]
TEST 1683/6171
[ext/iconv/tests/iconv-charset-length-cve-2007-4840.phpt]^MPASS iconv()
charset parameter length checks (CVE-2007-4840)
[ext/iconv/tests/iconv-charset-length-cve-2007-484
0.phpt]
TEST 1684/6171 [ext/iconv/tests/iconv001.phpt]^MPASS iconv() test 1
[ext/iconv/tests/iconv001.phpt]
TEST 1685/6171 [ext/iconv/tests/iconv002.phpt]^MPASS iconv() test 2
(UCS4BE to ASCII) [ext/iconv/tests/iconv002.phpt]
TEST 1686/6171 [ext/iconv/tests/iconv003.phpt]^MPASS iconv() test 3
[ext/iconv/tests/iconv003.phpt]
TEST 1687/6171 [ext/iconv/tests/iconv004.phpt]^MFAIL
iconv_mime_encode() sanity cheeck. [ext/iconv/tests/iconv004.phpt]
TEST 1688/6171
[ext/iconv/tests/iconv_mime_decode-charset-length-cve-2007-4840.phpt]^MPASS
iconv_mime_decode() charset parameter length checks (CVE-2007-4840)
[ext/iconv/tests/iconv_mim
e_decode-charset-length-cve-2007-4840.phpt]
TEST 1689/6171 [ext/iconv/tests/iconv_mime_decode.phpt]^MPASS
iconv_mime_decode() [ext/iconv/tests/iconv_mime_decode.phpt]
TEST 1690/6171
[ext/iconv/tests/iconv_mime_decode_headers-charset-length-cve-2007-4840.phpt]^MPASS
iconv_mime_decode_headers() charset parameter length checks
(CVE-2007-4840) [ext/iconv
/tests/iconv_mime_decode_headers-charset-length-cve-2007-4840.phpt]
TEST 1691/6171 [ext/iconv/tests/iconv_mime_decode_headers.phpt]^MFAIL
iconv_mime_decode_headers()
[ext/iconv/tests/iconv_mime_decode_headers.phpt]
TEST 1692/6171 [ext/iconv/tests/iconv_mime_encode.phpt]^MFAIL
iconv_mime_encode() [ext/iconv/tests/iconv_mime_encode.phpt]
TEST 1693/6171
[ext/iconv/tests/iconv_set_encoding-charset-length-cve-2007-4840.phpt]^MPASS
iconv_set_encoding() charset parameter length checks (CVE-2007-4840)
[ext/iconv/tests/iconv_s
et_encoding-charset-length-cve-2007-4840.phpt]
TEST 1694/6171 [ext/iconv/tests/iconv_stream_filter.phpt]^MFAIL iconv
stream filter [ext/iconv/tests/iconv_stream_filter.phpt]
TEST 1695/6171
[ext/iconv/tests/iconv_strlen-charset-length-cve-2007-4840.phpt]^MPASS
iconv_strlen() charset parameter length checks (CVE-2007-4840)
[ext/iconv/tests/iconv_strlen-charse
t-length-cve-2007-4840.phpt]
TEST 1696/6171 [ext/iconv/tests/iconv_strlen.phpt]^MFAIL iconv_strlen()
[ext/iconv/tests/iconv_strlen.phpt]
TEST 1697/6171
[ext/iconv/tests/iconv_strpos-charset-length-cve-2007-4840.phpt]^MPASS
iconv_strpos() charset parameter length checks (CVE-2007-4840)
[ext/iconv/tests/iconv_strpos-charse
t-length-cve-2007-4840.phpt]
TEST 1698/6171 [ext/iconv/tests/iconv_strpos.phpt]^MFAIL iconv_strpos()
[ext/iconv/tests/iconv_strpos.phpt]
TEST 1699/6171
[ext/iconv/tests/iconv_strrpos-charset-length-cve-2007-4840.phpt]^MPASS
iconv_strrpos() charset parameter length checks (CVE-2007-4840)
[ext/iconv/tests/iconv_strrpos-cha
rset-length-cve-2007-4840.phpt]
TEST 1700/6171 [ext/iconv/tests/iconv_strrpos.phpt]^MFAIL
iconv_strrpos() [ext/iconv/tests/iconv_strrpos.phpt]
TEST 1701/6171
[ext/iconv/tests/iconv_substr-charset-length-cve-2007-4783.phpt]^MPASS
iconv_substr() charset parameter length checks (CVE-2007-4783)
[ext/iconv/tests/iconv_substr-charse
t-length-cve-2007-4783.phpt]
TEST 1702/6171 [ext/iconv/tests/iconv_substr.phpt]^MFAIL iconv_substr()
[ext/iconv/tests/iconv_substr.phpt]
TEST 1703/6171
[ext/iconv/tests/ob_iconv_handler-charset-length-cve-2007-4840.phpt]^MPASS
ob_iconv_handler() charset parameter length checks (CVE-2007-4840)
[ext/iconv/tests/ob_iconv_ha
ndler-charset-length-cve-2007-4840.phpt]
TEST 1704/6171 [ext/iconv/tests/ob_iconv_handler.phpt]^MFAIL
ob_iconv_handler() [ext/iconv/tests/ob_iconv_handler.phpt]
TEST 1705/6171 [ext/iconv/tests/translit-failure.phpt]^MSKIP Translit
failure [ext/iconv/tests/translit-failure.phpt] reason: ICONV_IMPL !=
"libiconv"
TEST 1706/6171 [ext/iconv/tests/translit-utf8.phpt]^MSKIP Translit
UTF-8 quotes [ext/iconv/tests/translit-utf8.phpt] reason: ICONV_IMPL !=
"libiconv"

-


Previous Comm