Req #51717 [Opn->Csd]: Replace in-browser javascript terp with php terp

2010-06-03 Thread sjoerd
Edit report at http://bugs.php.net/bug.php?id=51717&edit=1

 ID:   51717
 Updated by:   sjo...@php.net
 Reported by:  scratch65535 at att dot net
 Summary:  Replace in-browser javascript terp with php terp
-Status:   Open
+Status:   Closed
 Type: Feature/Change Request
 Package:  Unknown/Other Function
 Operating System: any/all
 PHP Version:  Irrelevant
-Assigned To:  
+Assigned To:  sjoerd

 New Comment:

While I agree with you that Javascript leaves room for improvement, your
desire to 

use PHP in the browser is not going to see the light of day within the
PHP 

project. This feature would so big and separate from the current PHP 

implementation that it would be its own project. Of course, you are
welcome to 

start such a project.


Previous Comments:

[2010-05-01 17:25:18] scratch65535 at att dot net

Description:

PHP is already far more stable and solidly defined than Javascript or
any of its permutations is.  That advantage will continue through the
foreseeable future.



Providing a browser-resident php terp would allow people to exploit
their php experience to create client-side javascript-type functionality
without actually having to struggle with all the javascript craziness.



(Just a data point from personal experience:  I've been programming
since 1975, in everything from 8-bit Basic to CDC CP & PP assembly
languages.  After a month of struggle, I gave up on trying to add
javascript functionality to my php apps.  The evidence suggests that the
language was designed by a kitten with a ball of yarn.)







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


Bug #51934 [Opn]: strtotime plurals / incorrect time

2010-06-03 Thread sjoerd
Edit report at http://bugs.php.net/bug.php?id=51934&edit=1

 ID:   51934
 Updated by:   sjo...@php.net
 Reported by:  brent dot hansen at gmail dot com
 Summary:  strtotime plurals / incorrect time
 Status:   Open
 Type: Bug
 Package:  Date/time related
 Operating System: Win 7 Pro
 PHP Version:  5.3.2

 New Comment:

It interprets the S as Sierra Time Zone. Similar to:

echo date("Y-m-d H:i:s",strtotime("4 SundayPST ago"));


Previous Comments:

[2010-05-27 19:18:54] brent dot hansen at gmail dot com

Description:

Pluralization seems to remove 1 hour from calculation or drops daylight
savings adjustment.



Notes:

date.timezone = America/Los_Angeles

Correction to PHP version: 5.3.1

Test script:
---
date("Y-m-d H:i:s",strtotime("4 Sunday ago"));

date("Y-m-d H:i:s",strtotime("4 Sundays ago"));

Expected result:

2010-05-01 00:00:00

2010-05-01 00:00:00

Actual result:
--
2010-05-01 00:00:00

2010-04-30 23:00:00






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


Bug #51972 [Opn->Fbk]: PHP 5.3.x bug Require_once don't work with RELATIVE symbolic link

2010-06-03 Thread sjoerd
Edit report at http://bugs.php.net/bug.php?id=51972&edit=1

 ID:   51972
 Updated by:   sjo...@php.net
 Reported by:  jacques dot moati at happyend dot fr
 Summary:  PHP 5.3.x bug Require_once don't work with RELATIVE
   symbolic link
-Status:   Open
+Status:   Feedback
 Type: Bug
 Package:  *General Issues
 Operating System: Ubuntu Lucid Lynx
 PHP Version:  5.3.2

 New Comment:

Not enough information was provided for us to be able
to handle this bug. Please re-read the instructions at
http://bugs.php.net/how-to-report.php

If you can provide more information, feel free to add it
to this bug and change the status back to "Open".

Thank you for your interest in PHP.


I could not reproduce the problem.


Previous Comments:

[2010-06-02 11:04:19] jacques dot moati at happyend dot fr

Description:

Hello,



This bug is present into all 5.3 php version.

I test it in the ubuntu package, php 5.3 stable and snap version with
--disable-all for ./config compilation.



When you include a file in a relative (eg ../) symbolic link directory,
PHP don't include it and do a FATAL error.



files_existes and is_readable return true ...

If the symbolic link of the diectory is absolute, the include work
correctly ...







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


Req #51984 [Opn->Csd]: new operation ?= for $var = $var ? $var :"hello world"

2010-06-03 Thread sjoerd
Edit report at http://bugs.php.net/bug.php?id=51984&edit=1

 ID:  51984
 Updated by:  sjo...@php.net
 Reported by: fortruth at mabang dot net
 Summary: new operation ?=  for  $var = $var ? $var :"hello world"
-Status:  Open
+Status:  Closed
 Type:Feature/Change Request
 Package: Scripting Engine problem
 PHP Version: trunk-SVN-2010-06-03 (SVN)
-Assigned To: 
+Assigned To: sjoerd

 New Comment:

The ifsetor operator is planned for PHP6:

http://www.php.net/~derick/meeting-notes.html#ifsetor-as-replacement-for-foo-

isset-foo-foo-something-else


Previous Comments:

[2010-06-03 09:27:29] fortruth at mabang dot net

and this maybe more useful for 



stand for:



if(!$var)$var = "hello world";


[2010-06-03 08:52:13] fortruth at mabang dot net

Description:

as you have make ?: more easy. 

but I think there can be a more easy for other one.



like 



$var ?= "hello world";



there can be equal that 



$var = $var ? $var : "hello world";



for now short is 



$var = $var ? : "hello world";







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


Bug #51986 [Opn]: array_filter breaks references when a callback is used

2010-06-03 Thread sjoerd
Edit report at http://bugs.php.net/bug.php?id=51986&edit=1

 ID:   51986
 Updated by:   sjo...@php.net
 Reported by:  daniel dot menard at ehesp dot fr
 Summary:  array_filter breaks references when a callback is used
 Status:   Open
 Type: Bug
 Package:  Arrays related
 Operating System: Windows XP
 PHP Version:  5.3.2

 New Comment:

Use a reference in your callback function:



function my_trim(& $a)

{

return trim($a);

}


Previous Comments:

[2010-06-03 12:28:24] daniel dot menard at ehesp dot fr

Description:

I have an array and a variable which is a reference on some element in
this array:

$arr=array('a'); $ref = &$arr[0]



If I apply array_filter() with a callback like trim() or count() on the
array, the reference is broken and $ref is no longer a reference (If I
apply array_filter() without a callback, the reference is not altered
and the result is correct).



I think that this is a regression introduced in php 5.2.11: with the
test script below, 5.2.10 give the good result, 5.2.11 do not.



I also tested with the latest version (5.3.2): same result, reference is
broken.



PS: I tested on windows XP with packages php-5.x.y-Win32-VC6-x86.zip
provided on this page:
http://windows.php.net/downloads/releases/archives/

Test script:
---
// Init

$arr = array('some value');

$ref = & $arr[0];



// Change $arr

$arr[0] = 'ONE';

echo 'step 1. $ref is ', ($ref !== 'ONE') ? 'BROKEN' : 'OK', "\n";



// Apply array_filter (without callback) and change $arr

array_filter($arr);

$arr[0] = 'TWO';

echo 'step 2. $ref is ', ($ref !== 'TWO') ? 'BROKEN' : 'OK', "\n";



// Apply array_filter (with a callback) then change $arr

array_filter($arr,'trim');

$arr[0] = 'THREE';

echo 'step 3. $ref is ', ($ref !== 'THREE') ? 'BROKEN' : 'OK', "\n";

Expected result:

step 1. $ref is OK

step 2. $ref is OK

step 3. $ref is OK

Actual result:
--
step 1. $ref is OK

step 2. $ref is OK

step 3. $ref is BROKEN






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


Bug #49530 [Fbk->Csd]: SOAP header only results in function call when document/literal

2010-05-29 Thread sjoerd
Edit report at http://bugs.php.net/bug.php?id=49530&edit=1

 ID:   49530
 Updated by:   sjo...@php.net
 Reported by:  sjoerd-php at linuxonly dot nl
 Summary:  SOAP header only results in function call when
   document/literal
-Status:   Feedback
+Status:   Closed
 Type: Bug
 Package:  SOAP related
 Operating System: *
 PHP Version:  5.3.0
 Assigned To:  dmitry

 New Comment:

Could not reproduce.


Previous Comments:

[2010-05-28 13:43:08] dmi...@php.net

Both WSDLs work fine for me except for commented  line. The
client:



WSDL_CACHE_NONE, 'trace'=>true));

$cl->__setSoapHeaders(array(new
SoapHeader('http://www.myservice.nl/soap/',

'HeaderAuthenticate',

array('reactid'=>'test';

$ret = $cl->login('user', 'pass');

echo $ret . PHP_EOL;

echo $cl->__getLastRequest();

echo $cl->__getLastResponse();

?>

----
[2009-09-11 12:20:45] sjoerd-php at linuxonly dot nl

Description:

When a SOAP header is sent to a webservice which uses SoapServer, a
method with the same name as the header is called. However, this only
happens when the webservice is document/literal, not when it is
rpc/encoded.

Reproduce code:
---
http://pastebin.com/f7b1434d9

} else {

$wsdl = 'rpcencoded.wsdl'; // http://pastebin.com/fe989844

}



$handler = new SoapHandler();

$server = new SoapServer($wsdl);

$server->setObject($handler);

$server->handle();

?>

Expected result:

With both WSDLs, that the HeaderAuthenticate method is called. That is,
the X-Debug header contains "header was called" when the
HeaderAuthenticate header was sent.

Actual result:
--
The HeaderAuthenticate method is only called with document/literal WSDL.






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


#49851 [Csd]: http wrapper breaks on 1024 char long headers

2009-12-11 Thread sjoerd
 ID:   49851
 Updated by:   sjo...@php.net
 Reported By:  sjoerd-php at linuxonly dot nl
 Status:   Closed
 Bug Type: Streams related
 Operating System: *
 PHP Version:  5.*, 6
 New Comment:

This one is fixed. Filed bug #50451 "http wrapper breaks on 2048 char
long headers".


Previous Comments:


[2009-12-10 03:23:13] il...@php.net

This bug has been fixed in SVN.

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-12-10 03:23:05] s...@php.net

Automatic comment from SVN on behalf of iliaa
Revision: http://svn.php.net/viewvc/?view=revision&revision=291938
Log: Fixed bug #49851 (http wrapper breaks on 1024 char long headers).



[2009-12-02 18:46:39] j...@php.net

So it's a bug in streams code (http) and not server side. Your summary
for this bug report sucks and the category was wrong. And I should read
all comments. :) 



[2009-12-02 16:53:11] sjo...@php.net

Apache module.

The important thing is that a.php gives a header which is exactly 1024
bytes long, including \r\n. The file_get_contents than gives a wrong
result, and you can run that on the CLI or any other SAPI.



[2009-11-30 19:48:27] j...@php.net

What SAPI are you using? I can not reproduce this with fastcgi +
lighttpd..



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/49851

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



#49851 [Fbk->Opn]: HTTP breaks on long header line

2009-12-02 Thread sjoerd
 ID:   49851
 Updated by:   sjo...@php.net
 Reported By:  sjoerd-php at linuxonly dot nl
-Status:   Feedback
+Status:   Open
 Bug Type: HTTP related
 Operating System: *
 PHP Version:  5.*, 6
 New Comment:

Apache module.

The important thing is that a.php gives a header which is exactly 1024
bytes long, including \r\n. The file_get_contents than gives a wrong
result, and you can run that on the CLI or any other SAPI.


Previous Comments:


[2009-11-30 19:48:27] j...@php.net

What SAPI are you using? I can not reproduce this with fastcgi +
lighttpd..



[2009-10-24 08:08:10] sjo...@php.net

Thank you for your input. However, I disagree with your post.

> php internally does not have any hard coded limit
http_fopen_wrapper.c:75
#define HTTP_HEADER_BLOCK_SIZE  1024

> the header does not end with \r\n
This is not needed with header().

> $string = str_pad('X-Padding: ', 1022, 'x').'\r\n';
This appends \r\n instead of CRLF, because you use single quotes
instead of double quotes.



[2009-10-24 02:16:58] srina...@php.net

php internally does not have any hard coded limit to parse the header
value. the only time, you will see http header in your output is when
the header does not end with \r\n (to mark it as new line).

as per HTTP spec, every HTTP headers need to end with \r\n (CR LF) to
mark the end of the line. php internally checks for this line to
determine if the header is done before proceeding to parse the body of
the request. 

if you modify this below test case to reflect that there needs to be
\r\n to mark it as end of line, then you will see the expected output. 

http://www.google.nl/');
echo "Foo";
?>

i suggest marking this bug as bogus (or not an issue). 



[2009-10-12 21:16:11] lbarn...@php.net

Verified, since 5.1.0 at least.



[2009-10-12 20:24:53] sjo...@php.net

See also bug #49847 "exec() confused by a specially crafted string",
which has a similar cause.

>From http_fopen_wrapper.c:
while (!body && !php_stream_eof(stream)) {
size_t http_header_line_length;
if (php_stream_get_line(stream, http_header_line,
HTTP_HEADER_BLOCK_SIZE, &http_header_line_length) && *http_header_line
!= '\n' && *http_header_line != '\r') {
...
} else {
break;



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/49851

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



#50249 [Opn]: ordinal month days don't work

2009-11-23 Thread sjoerd
 ID:   50249
 Updated by:   sjo...@php.net
 Reported By:  jennifer dot kimball at nrc dot ca
 Status:   Open
 Bug Type: Date/time related
 Operating System: Solaris 10
 PHP Version:  5.3.1
 New Comment:

Thank you for your bug report.

Here is a piece of code which may do what you want:



Previous Comments:


[2009-11-20 18:18:22] jennifer dot kimball at nrc dot ca

Description:

It appears impossible to write an expression that will generate the Nth
day of any month (except for first or last days).

Expressions like "third day of next month" fail in date_create().
Expressions like "next month +3 days" increment the month number and
add 3 days to the current day number.
Expressions like "first day of next month +2 days" give just the first
day of the month.



Reproduce code:
---
//today is Nov 20, 2009

$d1=date_create('third day of next month');
print_r(DateTime::getLastErrors()); //errors
echo 'd1: ',$d1->format('Y-m-d'); //nothing output

$d2=date_create('first day of next month');
echo 'd2: ',$d2->format('Y-m-d'); //2009-12-01, works as expected

$d3=date_create('first day of next month +2 days');
echo 'd3: ',$d3->format('Y-m-d'); //2009-12-01, not 2009-12-03

$d4=date_create('next month +3 days');
echo 'd4: ',$d4->format('Y-m-d'); //2009-12-23, also not 2009-12-03
though I can understand why



Expected result:

Array
(
[warning_count] => 0
[warnings] => Array
(
)

[error_count] => 0
[errors] => Array
(
)

)
d1: 2009-12-03

d2: 2009-12-01

d3: 2009-12-03

d4: 2009-12-23

Actual result:
--
Array
(
[warning_count] => 0
[warnings] => Array
(
)

[error_count] => 1
[errors] => Array
(
[10] => The timezone could not be found in the database
)

)
d1: 

d2: 2009-12-01

d3: 2009-12-01 //still the 1st, 2 days not added

d4: 2009-12-23





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



#50080 [Opn]: 1 bit short of an 8 byte integer

2009-11-04 Thread sjoerd
 ID:   50080
 Updated by:   sjo...@php.net
 Reported By:  aidevelopment at gmail dot com
 Status:   Open
 Bug Type: Variables related
 Operating System: Linux 2.6.15-26-server
 PHP Version:  5.2.11
 New Comment:

In a 64 bit integer, 1 bit indicates the sign and 63 bits are left for
the number. Thus the range is from -2^63 to 2^63, giving 2^64 numbers.


Previous Comments:


[2009-11-04 16:14:21] aidevelopment at gmail dot com

Description:

Despite having PHP_INT_MAX set to 8 bytes, It is impossible to have an
int greater than
1000.
8 Byte, or 64 bit maximum should be
.

In my included example, it is clear that when attempting to increase
the value above(by adding 1), simply nothing happens.

Attempting to assign a variable to a number greater than the above
number produces unpredictable results.


Reproduce code:
---
";
$status = 0x7FFF;
for($i=0;$i<=4;$i++)
{
printf ("status = '%b'", $status);
$status++;
}
?>


Expected result:

Int Size = 8 bytes.
status =
'111'
status =
'1000'
status =
'1001'
status =
'1010'
status =
'1011'

Actual result:
--
Int Size = 8 bytes.
status =
'111'
status =
'1000'
status =
'1000'
status =
'1000'
status =
'1000'





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



#46264 [Opn]: FoxPro DBF files can not be opened

2009-11-03 Thread sjoerd
 ID:   46264
 Updated by:   sjo...@php.net
 Reported By:  pierre dot beaumadier at gmail dot com
 Status:   Open
 Bug Type: dBase related
 Operating System: GNU/Linux
 PHP Version:  5.2CVS-2008-10-09
 New Comment:

I've put the file Mr Moseby provided online here:
http://www.gissen.nl/files/mach07.DBF


Previous Comments:


[2009-11-01 20:28:11] sjo...@php.net

Asked for DBF files per e-mail.



[2009-10-29 12:19:20] jmoseby at elasticfabrics dot com

I have this problem too.  It is a major problem for me.  I can provide
example dbf files on request.

Running ubuntu hardy 2.6.24-19-generic.

#php --version
PHP 5.2.9-0.dotdeb.2 with Suhosin-Patch 0.9.7 (cli) (built: Apr  7 2009
20:42:41)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies



[2008-10-09 13:53:38] pierre dot beaumadier at gmail dot com

Same error with the latest snapshot.



[2008-10-09 12:24:38] j...@php.net

Not all fixed bugs are evident in the NEWS. Some people are lazy to
write proper descriptions.



[2008-10-09 12:19:14] pierre dot beaumadier at gmail dot com

For information I tested on this version :

$ php --version
PHP 5.2.4-2ubuntu5.3 with Suhosin-Patch 0.9.6.2 (cli) (built: Jul 23
2008 06:44:49) 
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies


I looked up in the bugs list but didn't see anything related to my
problem.

I will try to test the latest snapshot.



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/46264

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



#50051 [Fbk]: strtotime

2009-11-01 Thread sjoerd
 ID:  50051
 Updated by:  sjo...@php.net
 Reported By: tailinchu at gmail dot com
 Status:  Feedback
 Bug Type:Date/time related
 PHP Version: 5.2.11
 New Comment:

Strtotime('200910') creates a correct timestamp on today, with a time
of 20:09:10.


Previous Comments:


[2009-11-01 20:32:29] sjo...@php.net

Thank you for your bug report.

The string you supply, 200910, is not a complete date. Why do you think
this should return 2009-10-01?



[2009-11-01 20:29:16] tailinchu at gmail dot com

Description:

strtotime() cannot create correct timestamp.

Reproduce code:
---
echo date('Ymd',strtotime('200910'));

Expected result:

20091001

Actual result:
--
20091101





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



#50051 [Opn->Fbk]: strtotime

2009-11-01 Thread sjoerd
 ID:  50051
 Updated by:  sjo...@php.net
 Reported By: tailinchu at gmail dot com
-Status:  Open
+Status:  Feedback
 Bug Type:Date/time related
 PHP Version: 5.2.11
 New Comment:

Thank you for your bug report.

The string you supply, 200910, is not a complete date. Why do you think
this should return 2009-10-01?


Previous Comments:


[2009-11-01 20:29:16] tailinchu at gmail dot com

Description:

strtotime() cannot create correct timestamp.

Reproduce code:
---
echo date('Ymd',strtotime('200910'));

Expected result:

20091001

Actual result:
--
20091101





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



#46264 [Opn]: FoxPro DBF files can not be opened

2009-11-01 Thread sjoerd
 ID:   46264
 Updated by:   sjo...@php.net
 Reported By:  pierre dot beaumadier at gmail dot com
 Status:   Open
 Bug Type: dBase related
 Operating System: GNU/Linux
 PHP Version:  5.2CVS-2008-10-09
 New Comment:

Asked for DBF files per e-mail.


Previous Comments:


[2009-10-29 12:19:20] jmoseby at elasticfabrics dot com

I have this problem too.  It is a major problem for me.  I can provide
example dbf files on request.

Running ubuntu hardy 2.6.24-19-generic.

#php --version
PHP 5.2.9-0.dotdeb.2 with Suhosin-Patch 0.9.7 (cli) (built: Apr  7 2009
20:42:41)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies



[2008-10-09 13:53:38] pierre dot beaumadier at gmail dot com

Same error with the latest snapshot.



[2008-10-09 12:24:38] j...@php.net

Not all fixed bugs are evident in the NEWS. Some people are lazy to
write proper descriptions.



[2008-10-09 12:19:14] pierre dot beaumadier at gmail dot com

For information I tested on this version :

$ php --version
PHP 5.2.4-2ubuntu5.3 with Suhosin-Patch 0.9.6.2 (cli) (built: Jul 23
2008 06:44:49) 
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies


I looked up in the bugs list but didn't see anything related to my
problem.

I will try to test the latest snapshot.



[2008-10-09 09:19:27] pierre dot beaumadier at gmail dot com

I can send you an example dbf file if you need, as it seems impossible
to attach a file to a bug report



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/46264

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



#50048 [Opn->Fbk]: Strtotime Last fails

2009-11-01 Thread sjoerd
 ID:   50048
 Updated by:   sjo...@php.net
 Reported By:  arnbme at gmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Date/time related
 Operating System: Wamp or Linux
 PHP Version:  5.3.0
 New Comment:

Thank you for your bug report.

Your example prints the last Sunday for December 1st, 2009. The Sunday
before that date is November 29th. Can you explain why you think the
output is wrong? Also, could you provide a shorter reproduce script,
like this:




Previous Comments:


[2009-11-01 14:12:20] arnbme at gmail dot com

Description:

the last option of strtotime seems to ignore the int $now parameter. 

Reproduce code:
---
';
$mths =
array("","January","February","March","April","May","June","July","August","September","October","November","December");
$x = strtotime('2009-11-29');   //date to age
$Year = date("Y",$x);
$Month = date("m",$x);
if ($Month == 12){
$Year++;
$Month = 1;}
else
$Month++;
$n=strtotime($mths[$Month].' 01, '.$Year);
echo 'base date:',date("Y-m-d",$n),$br;
if ($n==false)
die ('bad date');
$nextdt=date( "Y-m-d",strtotime("last Sunday", $n));
echo 'Calc Last:',$nextdt,$br; //result is 2009-11-29 should be
2009-12-27
?>

Expected result:

Should show 2009-12-27

Actual result:
--
2009-11-29





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



#50028 [Opn]: dirname bug

2009-10-29 Thread sjoerd
 ID:   50028
 Updated by:   sjo...@php.net
 Reported By:  zgq0301 at gmail dot com
 Status:   Open
 Bug Type: Filesystem function related
 Operating System: *
 PHP Version:  5.2.11
 New Comment:

Thank you for your bug report.

You have html entities in your filename. Html entities are not
automatically decoded when used in filenames.


Previous Comments:


[2009-10-29 00:49:31] zgq0301 at gmail dot com

Description:

function dirname can't return a string which the last character is
chinese.



Reproduce code:
---
---
>From manual page: function.dirname#Description
---
code:
$file="D:\Backup\我的文档\网站根目录d\cms";
echo dirname($file);

then it print D:\Backup;
but when I add a english character:

$file="D:\Backup\我的文档\网站根目录d\cms";
echo dirname($file);

it can well done.

Expected result:

code:
$file="D:\Backup\我的文档\网站根目录d\cms";
echo dirname($file);

then it print D:\Backup;
but when I add a english character:

$file="D:\Backup\我的文档\网站根目录d\cms";
echo dirname($file);

it can well done.

Actual result:
--
code:
$file="D:\Backup\我的文档\网站根目录d\cms";
echo dirname($file);

then it print D:\Backup;
but when I add a english character:

$file="D:\Backup\我的文档\网站根目录d\cms";
echo dirname($file);

it can well done.





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



#50035 [Opn]: Segfault on Exit

2009-10-29 Thread sjoerd
 ID:   50035
 Updated by:   sjo...@php.net
 Reported By:  dhertel at gmail dot com
 Status:   Open
 Bug Type: Reproducible crash
 Operating System: linux 2.6.27
 PHP Version:  5.3.1RC2
 New Comment:

I could not reproduce the crash with either script.


Previous Comments:


[2009-10-29 15:07:59] dhertel at gmail dot com

I'm sorry i couln't provide a shorter script :-(. I can't reproduce the
segfault with a simple script.

I now stripped everything unnecessary from the script... doesn't need
anything external now...

Strange thing is that the segfault doesn't occur every time the script
ends but sometimes... and the more iterations mmae_core2 runs (line 59),
the more often it seems to occur

http://pastebin.org/49264



[2009-10-29 14:40:38] paj...@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.





[2009-10-29 14:12:29] dhertel at gmail dot com

Description:

I'm writing a CLI program with forking and ipc and stuff. It seems to
work fine but in the current test the script eventually produces a
segfault - every time... but only if i let it run until it's shutting
down itself. if i interrupt it, it shuts down without segfaulting

php -i says it's version 5.3.1RC3-dev but i also had this problem with
5.3.0 (which unfortunately i can't downgrade to anymore to make a trace
there)

when using valgrind to check memory the segfault doesn't happen

Reproduce code:
---
Though I don't believe that it's a problem with my actual code (as
there are no execute() lines in the Backtrace), here it is:

http://pastebin.org/49244

the PFW_* classes are for handling processes in general, the MMAE_*
classes are part of the actual software using PFW_*, where MMAE_Boot
stays but Core and Core2 are only for seing if my PFW_* actually works.

Expected result:

no segfault

Actual result:
--
segfault

so here's the back trace
#0  0xb7441570 in ?? ()
#1  0x080b88d3 in zm_shutdown_ps_mm (type=1, module_number=7) at
/usr/src/debug/php-5.3.1_git200910272307/ext/session/mod_mm.c:256
#2  0x080b6fd1 in zm_shutdown_session (type=1, module_number=7) at
/usr/src/debug/php-5.3.1_git200910272307/ext/session/session.c:2192
#3  0x081bde7a in module_destructor (module=0x82cd180) at
/usr/src/debug/php-5.3.1_git200910272307/Zend/zend_API.c:2098
#4  0x081c4192 in zend_hash_apply_deleter (ht=0x82bbbc0, p=0x82cd150)
at /usr/src/debug/php-5.3.1_git200910272307/Zend/zend_hash.c:611
#5  0x081c4457 in zend_hash_graceful_reverse_destroy (ht=0x82bbbc0) at
/usr/src/debug/php-5.3.1_git200910272307/Zend/zend_hash.c:646
#6  0x081b85ac in zend_shutdown () at
/usr/src/debug/php-5.3.1_git200910272307/Zend/zend.c:759
#7  0x0815d732 in php_module_shutdown () at
/usr/src/debug/php-5.3.1_git200910272307/main/main.c:2103
#8  0x0824569c in main (argc=2, argv=0xbff47784) at
/usr/src/debug/php-5.3.1_git200910272307/sapi/cli/php_cli.c:1385





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



#49851 [Fbk->Opn]: HTTP breaks on long header line

2009-10-24 Thread sjoerd
 ID:   49851
 Updated by:   sjo...@php.net
 Reported By:  sjoerd-php at linuxonly dot nl
-Status:   Feedback
+Status:   Open
 Bug Type: HTTP related
 Operating System: Linux 2.6.28 Ubuntu 9.0.4
 PHP Version:  5.3SVN-2009-10-12 (SVN)
 New Comment:

Thank you for your input. However, I disagree with your post.

> php internally does not have any hard coded limit
http_fopen_wrapper.c:75
#define HTTP_HEADER_BLOCK_SIZE  1024

> the header does not end with \r\n
This is not needed with header().

> $string = str_pad('X-Padding: ', 1022, 'x').'\r\n';
This appends \r\n instead of CRLF, because you use single quotes
instead of double quotes.


Previous Comments:


[2009-10-24 02:16:58] srina...@php.net

php internally does not have any hard coded limit to parse the header
value. the only time, you will see http header in your output is when
the header does not end with \r\n (to mark it as new line).

as per HTTP spec, every HTTP headers need to end with \r\n (CR LF) to
mark the end of the line. php internally checks for this line to
determine if the header is done before proceeding to parse the body of
the request. 

if you modify this below test case to reflect that there needs to be
\r\n to mark it as end of line, then you will see the expected output. 

http://www.google.nl/');
echo "Foo";
?>

i suggest marking this bug as bogus (or not an issue). 



[2009-10-12 21:16:11] lbarn...@php.net

Verified, since 5.1.0 at least.



[2009-10-12 20:24:53] sjo...@php.net

See also bug #49847 "exec() confused by a specially crafted string",
which has a similar cause.

>From http_fopen_wrapper.c:
while (!body && !php_stream_eof(stream)) {
size_t http_header_line_length;
if (php_stream_get_line(stream, http_header_line,
HTTP_HEADER_BLOCK_SIZE, &http_header_line_length) && *http_header_line
!= '\n' && *http_header_line != '\r') {
...
} else {
    break;



[2009-10-12 20:20:08] sjoerd-php at linuxonly dot nl

Description:

If a HTTP response contains an header of exactly 1024 characters, the
remaining headers are not parsed and are returned in the output.

Reproduce code:
---
http://localhost/a.php');
?>

a.php:
http://www.google.nl/');
echo "Foo";
?>

Expected result:

The homepage of google.nl.

Actual result:
--
Location: http://www.google.nl
Vary: Accept-Encoding
Content-Length: 3
Connection: close
Content-Type: text/html

Foo





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



#49932 [NEW]: Content-Location header is not overwritten

2009-10-20 Thread sjoerd-php at linuxonly dot nl
From: sjoerd-php at linuxonly dot nl
Operating system: Linux
PHP version:  5.2.11
PHP Bug Type: Apache2 related
Bug description:  Content-Location header is not overwritten

Description:

If you access a script by a name other than its filename, it generates a
Content-Location HTTP header. For example, if you request '/a' instead of
'/a.php', the Content-Location header contains 'a.php'.

If you try to override the Content-Location header in the script, like in
the code example below, the response contains two Content-Location headers.

Reproduce code:
---
http://www.example.org/a.php');
?>

Expected result:

One Content-Location header in result:
Content-Location: http://www.example.org/a.php

Actual result:
--
Two Content-Location headers in result:
Content-Location: a.php
Content-Location: http://www.example.org/a.php

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



#49908 [Opn]: php crashes when exception thrown in autoload

2009-10-18 Thread sjoerd
 ID:   49908
 Updated by:   sjo...@php.net
 Reported By:  fqqdk at freemail dot hu
 Status:   Open
 Bug Type: Reproducible crash
 Operating System: windows xp sp3
 PHP Version:  5.3.0
 New Comment:

Could reproduce with php 5.3-head.
Backtrace: http://pastebin.com/f35c15146


Previous Comments:


[2009-10-17 13:31:30] fqqdk at freemail dot hu

Description:

PHP crashes with the below code:

Reproduce code:
---
function __autoload($className) {
if($className == 'Foo') {
class Foo implements Bar {};
} else {
throw new Exception;
}
}

new Foo;

Expected result:

I don't know what to expect. The manual says, that you can't catch an 
exeption thrown in an autoload function, but the crash only happens
when 
the autoload function gets called the second time. Below code doesn't 
crash, but instead produces a Fatal error:
function __autoload($className) {
  throw new Exception;
}
new Foo;

Actual result:
--
Faulting application php.exe, version 5.3.0.0, faulting module 
php5ts.dll, version 5.3.0.0, fault address 0x0002358a.





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



#49902 [Opn->Fbk]: Crash.

2009-10-16 Thread sjoerd
 ID:   49902
 Updated by:   sjo...@php.net
 Reported By:  asdas at yahoo dot co dot uk
-Status:   Open
+Status:   Feedback
 Bug Type: *General Issues
 Operating System: Windows Xp(SP2)
 PHP Version:  5.2.11
 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.




Previous Comments:


[2009-10-16 15:14:42] asdas at yahoo dot co dot uk

Description:

> Faulting application httpd.exe, version 2.2.11.0, faulting module
> php5ts.dll, version 5.2.9.9, fault address 0x000ca0da.
> 
> The instruction as 0x0086c8bd referenced memory as 0x01c8229c.

Reproduce code:
---
> Faulting application httpd.exe, version 2.2.11.0, faulting module
> php5ts.dll, version 5.2.9.9, fault address 0x000ca0da.
> 
> The instruction as 0x0086c8bd referenced memory as 0x01c8229c.

Expected result:

crash.






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



#49895 [Opn->Bgs]: Unable to run PHP code

2009-10-16 Thread sjoerd
 ID:   49895
 Updated by:   sjo...@php.net
 Reported By:  quentria at yahoo dot com dot tw
-Status:   Open
+Status:   Bogus
 Bug Type: Unknown/Other Function
 Operating System: Windows
 PHP Version:  5.2.11
 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.




Previous Comments:


[2009-10-16 04:31:02] quentria at yahoo dot com dot tw

Sorry I made a mistake when filling in the textboxes.

It should be as follow


Expected result:

Hello, world

OR

Hello,world

Actual result:
--


OR

Hello, world

"; ?>



[2009-10-16 04:27:33] quentria at yahoo dot com dot tw

Description:

Help! I was doing my coding as usual and everything was working fine. I
left my PC for a short while and after I came back to continue with my
work, errors just keep one showing. I then tried to run the previous
codes that I've already done and was working fine before I left my PC,
all of them do not work anymore! The only PHP page that runs properly is
my PHP Info page. I even tried to uninstall and reinstall my PHP, but
the problems still remains.

Reproduce code:
---
 


OR


Hello, world";
?> 

Expected result:




OR



Hello,world

Actual result:
--
Hello, world


OR


Hello, world

"; ?> 





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



#49874 [Fbk->Opn]: ftell()/fseek() inconsistency when using stream filters

2009-10-16 Thread sjoerd
 ID:   49874
 Updated by:   sjo...@php.net
 Reported By:  jketterl at chipxonio dot de
-Status:   Feedback
+Status:   Open
 Bug Type: Filesystem function related
 Operating System: linux (ubuntu)
 PHP Version:  5.2.11


Previous Comments:


[2009-10-15 06:54:31] jketterl at chipxonio dot de

thanks for having a look

i tried with and without. the challenge is to get it working without,
because that's the worst case my app has to deal with, but the BOM
doesn't seem to solve this.

$ hexdump test-with-bom.csv
000 feff 004c 0069 006e 0065 0020 0030 0031
010 000a 004c 0069 006e 0065 0020 0030 0032
020 000a 004c 0069 006e 0065 0020 0030 0033
030 000a 004c 0069 006e 0065 0020 0030 0034
040 000a
042

$ php test.php
string(8) "Line 01
"
string(8) "Line 02
"
string(8) "Line 01
"
string(5) "e 01
"

i also tried opening the file including the BOM without a stream
filter, but that just resulted in php reading in two extra chars (the
BOM converted in some way i guess) on the beginning of the first line.

i thought i'd attach the sample files to this bug, but it seems like i
can't. i've uploaded them here instead:
http://www.djmacgyver.net/tmp/php-ftell/



[2009-10-14 16:40:00] sjo...@php.net

Thank you for your bug report. Does your test.csv file start with a
BOM? You can determine this by viewing the file in a hex editor. If it
starts with fffe or feff, it has a BOM (byte order mark).



[2009-10-14 11:39:39] jketterl at chipxonio dot de

Description:

exact php version: PHP 5.2.11-0.dotdeb.1 with Suhosin-Patch 0.9.7 (cli)
(built: Sep 20 2009 09:41:43)
this bug is also be filter-/stream-related. i just believe it might be
easier to fix on the filesystem side, that's why i chose that category.

when using a php stream filter to convert input from utf-16 into
iso8859 (or most probably from any 2byte-encoded charset into any
single-byte-encode charset) the ftell() and fseek() functions start to
behave inconsistently.

more precisely: fseek() jumps to exact offsets ignoring the
2byte-encoding, whereas ftell() seems to return the number of bytes read
*after* the filter has been applied. thus it is not possible to fseek()
back to a certain offset that has been stored with ftell() before.

the content of the testfile used in the code examples is as follows:
Line 01
Line 02
Line 03
Line 04

Reproduce code:
---
$file = 'test.csv';

$fp = fopen($file, 'r');
stream_filter_append($fp, 'convert.iconv.utf16/iso8859-15');
$line = fgets($fp);
var_dump($line);
$line = fgets($fp);
var_dump($line);
fclose($fp);

$fp = fopen($file, 'r');
stream_filter_append($fp, 'convert.iconv.utf16/iso8859-15');
$line = fgets($fp);
var_dump($line);
fseek($fp, ftell($fp)); // this shouldn't move anything - but it
does...
$line = fgets($fp);
var_dump($line);
fclose($fp);

Expected result:

string(8) "Line 01
"
string(8) "Line 02
"
string(8) "Line 01
"
string(8) "Line 02
"

Actual result:
--
string(8) "Line 01
"
string(8) "Line 02
"
string(8) "Line 01
"
string(4) " 01
"





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



#49827 [Opn->Bgs]: shell_exec using ls /home fails with Permission denied

2009-10-14 Thread Sjoerd
 ID:   49827
 Updated by:   sjo...@php.net
 Reported By:  bill dot mcclendon at digiconllc dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Unknown/Other Function
 Operating System: Linux RH
 PHP Version:  5.2.11
 New Comment:

Thank you for your feedback.

The behavior you report is not a bug in PHP. The 'ls' program is
executed succesfully and it gives the 'Permission denied' error, not
PHP.

The home directory may be mounted over NFS or there may be some other
reason why there are additional access restrictions. 


Previous Comments:


[2009-10-13 18:37:09] bill dot mcclendon at digiconllc dot com

PHP bug reporting/support.

1) No ACL's (you think I didn't check this already?)
2) You mean grave accent? Yes - same error (I checked that already
too).

It's not running in a VM either.

Bill



[2009-10-10 12:02:17] sjo...@php.net

Thank you for your bug report.

Does your installation have other access control than UNIX permissions,
such as ACL? Can you succesfully execute 'ls /home' from the command
line, or using backticks in PHP?



[2009-10-09 22:49:50] bill dot mcclendon at digiconllc dot com

Corrected email address (your form seems to have a problem)



[2009-10-09 22:48:30] bill dot mcclendon at digiconllc dot com

Description:

Running Apache 2.x and PHP 5.2

safe_mode = off

test case - using ""
produces the error "ls: /home Permission denied"
using "" succeeds

(check the Apache error_log for errors)

However, both "/home" and "/usr" have the EXACT same permission and
ownership.

and Apache is running with "User owner" where "owner" is the owner of
the contents of "/home".  

Listing of both paths:

  8 drwxr-xr-x   15 root   root4096 Jun 24  2005 usr
  8 drwxr-xr-x5 root   root4096 Jan  8  2007 home

Shell is "/bin/bash" and it looks like:

764 -rwxr-xr-x  1 root root 772760 Dec  6  2004 /bin/bash


Any ideas?

Reproduce code:
---
Test cases:
FAIL:

".shell_exec($cmd)."";
?>

SUCCESS:
".shell_exec($cmd)."";
?>

Expected result:

Listing of files:

SUCCESS result:

bin
etc
games
include
kerberos
lib
lib64
libexec
local
sbin
share
src
tmp
X11R6


Actual result:
--
For FAIL above (no results).





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



#49874 [Bgs->Fbk]: ftell()/fseek() inconsistency when using stream filters

2009-10-14 Thread Sjoerd
 ID:   49874
 Updated by:   sjo...@php.net
 Reported By:  jketterl at chipxonio dot de
-Status:   Bogus
+Status:   Feedback
 Bug Type: Filesystem function related
 Operating System: linux (ubuntu)
 PHP Version:  5.2.11


Previous Comments:


[2009-10-14 16:40:00] sjo...@php.net

Thank you for your bug report. Does your test.csv file start with a
BOM? You can determine this by viewing the file in a hex editor. If it
starts with fffe or feff, it has a BOM (byte order mark).



[2009-10-14 11:39:39] jketterl at chipxonio dot de

Description:

exact php version: PHP 5.2.11-0.dotdeb.1 with Suhosin-Patch 0.9.7 (cli)
(built: Sep 20 2009 09:41:43)
this bug is also be filter-/stream-related. i just believe it might be
easier to fix on the filesystem side, that's why i chose that category.

when using a php stream filter to convert input from utf-16 into
iso8859 (or most probably from any 2byte-encoded charset into any
single-byte-encode charset) the ftell() and fseek() functions start to
behave inconsistently.

more precisely: fseek() jumps to exact offsets ignoring the
2byte-encoding, whereas ftell() seems to return the number of bytes read
*after* the filter has been applied. thus it is not possible to fseek()
back to a certain offset that has been stored with ftell() before.

the content of the testfile used in the code examples is as follows:
Line 01
Line 02
Line 03
Line 04

Reproduce code:
---
$file = 'test.csv';

$fp = fopen($file, 'r');
stream_filter_append($fp, 'convert.iconv.utf16/iso8859-15');
$line = fgets($fp);
var_dump($line);
$line = fgets($fp);
var_dump($line);
fclose($fp);

$fp = fopen($file, 'r');
stream_filter_append($fp, 'convert.iconv.utf16/iso8859-15');
$line = fgets($fp);
var_dump($line);
fseek($fp, ftell($fp)); // this shouldn't move anything - but it
does...
$line = fgets($fp);
var_dump($line);
fclose($fp);

Expected result:

string(8) "Line 01
"
string(8) "Line 02
"
string(8) "Line 01
"
string(8) "Line 02
"

Actual result:
--
string(8) "Line 01
"
string(8) "Line 02
"
string(8) "Line 01
"
string(4) " 01
"





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



#49874 [Opn->Bgs]: ftell()/fseek() inconsistency when using stream filters

2009-10-14 Thread Sjoerd
 ID:   49874
 Updated by:   sjo...@php.net
 Reported By:  jketterl at chipxonio dot de
-Status:   Open
+Status:   Bogus
 Bug Type: Filesystem function related
 Operating System: linux (ubuntu)
 PHP Version:  5.2.11
 New Comment:

Thank you for your bug report. Does your test.csv file start with a
BOM? You can determine this by viewing the file in a hex editor. If it
starts with fffe or feff, it has a BOM (byte order mark).


Previous Comments:


[2009-10-14 11:39:39] jketterl at chipxonio dot de

Description:

exact php version: PHP 5.2.11-0.dotdeb.1 with Suhosin-Patch 0.9.7 (cli)
(built: Sep 20 2009 09:41:43)
this bug is also be filter-/stream-related. i just believe it might be
easier to fix on the filesystem side, that's why i chose that category.

when using a php stream filter to convert input from utf-16 into
iso8859 (or most probably from any 2byte-encoded charset into any
single-byte-encode charset) the ftell() and fseek() functions start to
behave inconsistently.

more precisely: fseek() jumps to exact offsets ignoring the
2byte-encoding, whereas ftell() seems to return the number of bytes read
*after* the filter has been applied. thus it is not possible to fseek()
back to a certain offset that has been stored with ftell() before.

the content of the testfile used in the code examples is as follows:
Line 01
Line 02
Line 03
Line 04

Reproduce code:
---
$file = 'test.csv';

$fp = fopen($file, 'r');
stream_filter_append($fp, 'convert.iconv.utf16/iso8859-15');
$line = fgets($fp);
var_dump($line);
$line = fgets($fp);
var_dump($line);
fclose($fp);

$fp = fopen($file, 'r');
stream_filter_append($fp, 'convert.iconv.utf16/iso8859-15');
$line = fgets($fp);
var_dump($line);
fseek($fp, ftell($fp)); // this shouldn't move anything - but it
does...
$line = fgets($fp);
var_dump($line);
fclose($fp);

Expected result:

string(8) "Line 01
"
string(8) "Line 02
"
string(8) "Line 01
"
string(8) "Line 02
"

Actual result:
--
string(8) "Line 01
"
string(8) "Line 02
"
string(8) "Line 01
"
string(4) " 01
"





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



#49873 [Opn->Bgs]: array_map + htmlspecialchars_decode problem

2009-10-14 Thread Sjoerd
 ID:   49873
 Updated by:   sjo...@php.net
 Reported By:  webmaster at flex-code dot net
-Status:   Open
+Status:   Bogus
 Bug Type: Unknown/Other Function
 Operating System: Ubuntu Linux
 PHP Version:  5.3.0
 New Comment:

Thank you for your report.

The behavior you report is not a bug. Also note that bugs.php.net is
not a place to ask for support; it is a place to file bugs. For support,
please see:
http://nl2.php.net/support.php

Please try:
array_map('htmlspecialchars_decode', $anArray);


Previous Comments:


[2009-10-14 11:38:41] webmaster at flex-code dot net

Description:

Trying to decode encoded html special characters by using the array_map
and htmlspecialchars_decode functions returns an error by
htmlspecialchars_decode.

Reproduce code:
---
return array_map('htmlspecialchars_decode', array($aArray,
ENT_QUOTES));

Expected result:

All encoded special characters should be decoded to their respective
html characters, eg. ' => ', " => "

Actual result:
--
ERRNO: 2
TEXT: htmlspecialchars_decode() expects parameter 1 to be string, array
given
LOCATION:
/var/www/live/i/intranet-rewrite/base/includes/class_postgres.php, line
345, at October 14, 2009, 1:25 pm

Debug Backtrace:

- htmlspecialchars_decode(Array[57]) # line 0, file: unknown
- array_map("htmlspecialchars_decode", Array[2]) # line 345, file:
/var/www/live/i/intranet-rewrite/base/includes/class_postgres.php
- Resultset.convertCharacters(Array[57]) # line 336, file:
/var/www/live/i/intranet-rewrite/base/includes/class_postgres.php
- Resultset.fetchRow() # line 87, file:
/var/www/live/i/intranet-rewrite/hr/person_add_edit.php





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



#49871 [Opn->Bgs]: unexpected result converting float to int

2009-10-14 Thread sjoerd
 ID:   49871
 Updated by:   sjo...@php.net
 Reported By:  daniel dot buschke at nextiraone dot de
-Status:   Open
+Status:   Bogus
 Bug Type: Math related
 Operating System: Linux
 PHP Version:  5.2.11
 New Comment:

Floating point values have a limited precision. Hence a value might 
not have the same string representation after any processing. That also
includes writing a floating point value in your script and directly 
printing it without any mathematical operations.

If you would like to know more about "floats" and what IEEE
754 is, read this:
http://docs.sun.com/source/806-3568/ncg_goldberg.html
 
Thank you for your interest in PHP.




Previous Comments:


[2009-10-14 08:36:03] daniel dot buschke at nextiraone dot de

Description:

Hi,
when I convert following float:

float(232)

into an int I get:

int(231).


The float was calculated by 2.32 * 100. I know that this may result in
232.001 or 231.9 but the behavior is unexcpected because
var_dump does not show the real (more or less wrong) float number.

This one is exact the same as #2835 but the bug was closed without any
further comments. The provided solution is unacceptable.

How to convert 2.32 into an integer of the value 232?


BTW: Please do not set this bug to bogus or closed with the default
text for that problem ;-). As you can see in your bugtracker the
community wants a solution for that. Please also remember that PHP is a
scripting language which mainly ignores datatypes. This problem is not
comprehensible to beginners (webdesigners ;-) ).


I do not want to blame you with that but I just want to find a usefull
solution. Please keep communication with community.


regards
Daniel

Reproduce code:
---



Expected result:

- 2.32 
float(2.32)
float(232)
int(232)
- 8.28 
float(8.28)
float(828)
int(828)


or (but not preferred ;-) )

- 2.32 
float(2.32)
float(231.999)
int(231)
- 8.28 
float(8.28)
float(827.999)
int(827)


Actual result:
--
- 2.32 
float(2.32)
float(232)
int(231)
- 8.28 
float(8.28)
float(828)
int(827)






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



#49855 [Ver]: import_request_variables always return false in any codition.

2009-10-14 Thread sjoerd
 ID:   49855
 Updated by:   sjo...@php.net
 Reported By:  easyeagel at gmx dot com
 Status:   Verified
 Bug Type: HTTP related
 Operating System: Linux
 PHP Version:  5.2.11
 New Comment:

Patch: http://pastebin.com/f236dcf35


Previous Comments:


[2009-10-13 10:55:20] sjo...@php.net

Actually, it seems to return null, not false.



[2009-10-13 02:16:16] easyeagel at gmx dot com

Description:

the import_request_variables always return false in any condition.

Reproduce code:
---
---
>From manual page: function.import-request-variables#Return Values
---

if(import_request_variables('p', 'post_'))
{
echo "unimport the request";
phpinfo();
}

if(isset($post_username))
{
echo "", $post_username, "";
}

if(isset($post_email))
{
echo "", $post_email, "";
}

if(isset($post_message))
{
echo "", $post_message, "";
}

Expected result:

I think the import_request_varibles return true

Actual result:
--
it return false, and return false anytime, if I run php5 in command
line or in apache.





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



#49868 [Opn]: max_execution_time affected by max_input_time

2009-10-13 Thread Sjoerd
 ID:   49868
 Updated by:   sjo...@php.net
 Reported By:  majkl578 at gmail dot com
 Status:   Open
 Bug Type: Scripting Engine problem
 Operating System: Linux Debian
 PHP Version:  5.3SVN-2009-10-13 (snap)
 New Comment:

See also bug #37306 max_execution_time = max_input_time


Previous Comments:


[2009-10-13 17:41:55] majkl578 at gmail dot com

Description:

PHP ignores the max_execution_time set in php.ini and sets (somehow
internally) it to the value of max_input_time. ini_get returns correct
values of both of these settings, but the script is halted after the
time set as max_input_time.

This bug affects PHP5.3RC1 and also the latest snapshot of PHP5.3.
It is probably similar to an old bug #37306.

Related php.ini values:
max_execution_time = 5
max_input_time = 10

Configure command:
./configure --prefix=/usr --sysconfdir=/etc --cache-file=./config.cache
--with-config-file-path=/etc/php
--with-config-file-scan-dir=/etc/php/extensions
--with-apxs2=/usr/bin/apxs2 --with-mysql --with-mysqli --with-curl
--with-sqlite --enable-sqlite-utf8 --with-gd --enable-mbstring
--with-openssl --disable-short-tags --with-mcrypt --with-bz2 --with-zlib
--enable-zip --with-xmlrpc --enable-soap --without-mssql --with-pgsql
--with-tidy --enable-debug --disable-posix --enable-exif --enable-ftp
--with-gettext --with-mhash --enable-pcntl --with-pspell
--enable-sockets --with-xsl --enable-cli --enable-calendar --disable-cgi
--enable-zend-multibyte

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



#49855 [Opn->Ver]: import_request_variables always return false in any codition.

2009-10-13 Thread sjoerd
 ID:   49855
 Updated by:   sjo...@php.net
 Reported By:  easyeagel at gmx dot com
-Status:   Open
+Status:   Verified
 Bug Type: HTTP related
 Operating System: Linux
 PHP Version:  5.2.11
 New Comment:

Actually, it seems to return null, not false.


Previous Comments:


[2009-10-13 02:16:16] easyeagel at gmx dot com

Description:

the import_request_variables always return false in any condition.

Reproduce code:
---
---
>From manual page: function.import-request-variables#Return Values
---

if(import_request_variables('p', 'post_'))
{
echo "unimport the request";
phpinfo();
}

if(isset($post_username))
{
echo "", $post_username, "";
}

if(isset($post_email))
{
echo "", $post_email, "";
}

if(isset($post_message))
{
echo "", $post_message, "";
}

Expected result:

I think the import_request_varibles return true

Actual result:
--
it return false, and return false anytime, if I run php5 in command
line or in apache.





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



#49853 [Opn]: Soap Client stream context option is ignored

2009-10-13 Thread sjoerd
 ID:   49853
 Updated by:   sjo...@php.net
 Reported By:  rumana024 at yahoo dot com
 Status:   Open
 Bug Type: SOAP related
 Operating System: Windows XP
 PHP Version:  5.2SVN-2009-10-12 (SVN)
 New Comment:

Thank you for your bug report.

Please try 'http' as wrapper name instead of 'https'.


Previous Comments:


[2009-10-12 23:18:28] rumana024 at yahoo dot com

Description:

Hi:


I am using PHP Soap PHP-SOAP/5.2.9-2 to connect to a web service. Part
of the reqiurment is that , few http headers need to be as part of the
request, but not part of the soap envelope. I am using the stream
context option and add the http headers with that option. Unfortunately,
the stream context is not being read at all. 




Reproduce code:
---
Here is my code 


$opts = array(
  'https'=>array(
'method'=>"GET",
'header'=>'X-SECURITY-USERID: seller_1253314668_biz_api1.x.com\r\n'
. 
  'X-SECURITY-PASSWORD: 1253314679\r\n' .
  'X-SECURITY-SIGNATURE:
AtQaNHC.hbpghF5uGCRO99PVY6a2ASO58V7ki3.SAb3vQzBlBAxEyi0b\r\n' .
  'X-SERVICE-VERSION: 1.2.0\r\n' .
  'X-MESSAGE-PROTOCOL: SOAP11\r\n' .
  'X-REQUEST-SOURCE: PLATFORM_JAVA_SOAP_SAMPLE_V1\r\n' .
  'X-APPLICATION-ID: APP-80W284485P519543T\r\n'));


$context = stream_context_create($opts);


$soapClient = new SoapClient(null,array('location' =>
"https://svcs.sandbox.x.com/AP/Method1/";,
'uri' =>
"http://svcs.x.com/types/ap";, 
'soap_version' => SOAP_1_1,
'trace' => 1, 'stream_context' => $context));



 

Expected result:

Security Credential are going as HTTP Headers and the Http headers are
contained in the context parameter. I get the result Invalid User name
and Password. So the context is not going through at all.
I know for sure the credentials are valid.

I know other option parameter like 'location', 'uri' are working.Please
advice how to fix this problem.






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



#49851 [Opn]: HTTP breaks on long header line

2009-10-12 Thread Sjoerd
 ID:   49851
 Updated by:   sjo...@php.net
 Reported By:  sjoerd-php at linuxonly dot nl
 Status:   Open
 Bug Type: HTTP related
 Operating System: Linux 2.6.28 Ubuntu 9.0.4
 PHP Version:  5.3SVN-2009-10-12 (SVN)
 New Comment:

See also bug #49847 "exec() confused by a specially crafted string",
which has a similar cause.

>From http_fopen_wrapper.c:
while (!body && !php_stream_eof(stream)) {
size_t http_header_line_length;
if (php_stream_get_line(stream, http_header_line,
HTTP_HEADER_BLOCK_SIZE, &http_header_line_length) && *http_header_line
!= '\n' && *http_header_line != '\r') {
...
} else {
break;


Previous Comments:
--------

[2009-10-12 20:20:08] sjoerd-php at linuxonly dot nl

Description:

If a HTTP response contains an header of exactly 1024 characters, the
remaining headers are not parsed and are returned in the output.

Reproduce code:
---
http://localhost/a.php');
?>

a.php:
http://www.google.nl/');
echo "Foo";
?>

Expected result:

The homepage of google.nl.

Actual result:
--
Location: http://www.google.nl
Vary: Accept-Encoding
Content-Length: 3
Connection: close
Content-Type: text/html

Foo





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



#49847 [Ana]: exec() confused by a specially crafted string

2009-10-12 Thread Sjoerd
 ID:   49847
 Updated by:   sjo...@php.net
 Reported By:  soner at comixwall dot org
 Status:   Analyzed
 Bug Type: Program Execution
 Operating System: OpenBSD, Linux, Windows
 PHP Version:  5.2.11
 New Comment:

Filed Bug #49851 "HTTP breaks on long header line", which has the same
cause.


Previous Comments:


[2009-10-12 19:28:18] sjo...@php.net

>From exec.c:125:
while (php_stream_get_line(stream, ... b, EXEC_INPUT_BUF, &bufl)) {
/* no new line found, let's read some more */
if (b[bufl - 1] != '\n' && !php_stream_eof(stream)) {
...
continue;
...
add_next_index_stringl(array, buf, bufl, 1);

php_stream_get_line reads all the data. No newline is found, because
there is none. The reading has not yet triggered php_stream_eof, because
reading has stopped just before the bytes ran out. Loop starts again.
php_stream_get_line now reads no bytes at all, because no bytes are
left. Loop quits without adding the string to the array.



[2009-10-12 19:01:54] sjo...@php.net

The trick is that the string which is output is 4095 bytes long.

exec("printf %4095d 1", $output);
print_r($output);



[2009-10-12 16:57:11] soner at comixwall dot org

Description:

When shell command returns a specially crafted string, I get an empty
array as $output of exec(), instead of the string. I can very easily
reproduce this issue, please see below for test code.

Reproduce code:
---
Put the following lines in bug.php:



Then put the contents at the following link in echostr.php:
http://comixwall.org/dmdocuments/echostr

Expected result:

When you execute bug.php, you will get an empty array printed out:

Array
(
)

Actual result:
--
Actually, $output should have contained the string above as element 0
of the array.

If you delete or add a character in the string, exec() runs correctly
and you get the intended result. So the issue is specific to this
special string.

The problem is not with the size of the string, because much longer
strings are fine.

Also this issue does *not* exists with passthru(), shell_exec()
functions and backtick operator. Furthermore, exec() return value, i.e.
the last line of shell command output seems fine too (it contains the
string correctly). So I believe the issue is internal to exec(),
effecting $output contents only.

As you can guess, this string is in fact serialized openvpn startup log
lines (I just escaped the single quotes for testing purposes, that's
all), it is not some manually crafted string. Therefore, it is possible
that I may get more than one similar situation in the future.

I have confirmed this issue on OpenBSD, Linux, and Windows. Here are
the versions:

OpenBSD:
PHP 5.2.8 with Suhosin-Patch 0.9.6.3 (cli) (built: Mar  1 2009
10:26:06) 
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
with Suhosin v0.9.27, Copyright (c) 2007, by SektionEins GmbH

Linux:
PHP 5.2.6-3ubuntu4.2 with Suhosin-Patch 0.9.6.2 (cli) (built: Aug 21
2009 21:43:13) 
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies

Windows:
PHP 5.2.11 (cli) (built: Sep 16 2009 19:39:46)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

Since Windows version is without Suhosin patch, suhosin as culprit is
ruled out. (Also to test on Windows, I changed the exec shell command as
'php.exe echostr.php' of course.)






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



#49851 [NEW]: HTTP breaks on long header line

2009-10-12 Thread sjoerd-php at linuxonly dot nl
From: sjoerd-php at linuxonly dot nl
Operating system: Linux 2.6.28 Ubuntu 9.0.4
PHP version:  5.3SVN-2009-10-12 (SVN)
PHP Bug Type: HTTP related
Bug description:  HTTP breaks on long header line

Description:

If a HTTP response contains an header of exactly 1024 characters, the
remaining headers are not parsed and are returned in the output.

Reproduce code:
---
http://localhost/a.php');
?>

a.php:
http://www.google.nl/');
echo "Foo";
?>

Expected result:

The homepage of google.nl.

Actual result:
--
Location: http://www.google.nl
Vary: Accept-Encoding
Content-Length: 3
Connection: close
Content-Type: text/html

Foo

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



#49847 [Ver->Ana]: exec() confused by a specially crafted string

2009-10-12 Thread Sjoerd
 ID:   49847
 Updated by:   sjo...@php.net
 Reported By:  soner at comixwall dot org
-Status:   Verified
+Status:   Analyzed
 Bug Type: Program Execution
 Operating System: OpenBSD, Linux, Windows
 PHP Version:  5.2.11


Previous Comments:


[2009-10-12 19:28:18] sjo...@php.net

>From exec.c:125:
while (php_stream_get_line(stream, ... b, EXEC_INPUT_BUF, &bufl)) {
/* no new line found, let's read some more */
if (b[bufl - 1] != '\n' && !php_stream_eof(stream)) {
...
continue;
...
add_next_index_stringl(array, buf, bufl, 1);

php_stream_get_line reads all the data. No newline is found, because
there is none. The reading has not yet triggered php_stream_eof, because
reading has stopped just before the bytes ran out. Loop starts again.
php_stream_get_line now reads no bytes at all, because no bytes are
left. Loop quits without adding the string to the array.



[2009-10-12 19:01:54] sjo...@php.net

The trick is that the string which is output is 4095 bytes long.

exec("printf %4095d 1", $output);
print_r($output);



[2009-10-12 16:57:11] soner at comixwall dot org

Description:

When shell command returns a specially crafted string, I get an empty
array as $output of exec(), instead of the string. I can very easily
reproduce this issue, please see below for test code.

Reproduce code:
---
Put the following lines in bug.php:



Then put the contents at the following link in echostr.php:
http://comixwall.org/dmdocuments/echostr

Expected result:

When you execute bug.php, you will get an empty array printed out:

Array
(
)

Actual result:
--
Actually, $output should have contained the string above as element 0
of the array.

If you delete or add a character in the string, exec() runs correctly
and you get the intended result. So the issue is specific to this
special string.

The problem is not with the size of the string, because much longer
strings are fine.

Also this issue does *not* exists with passthru(), shell_exec()
functions and backtick operator. Furthermore, exec() return value, i.e.
the last line of shell command output seems fine too (it contains the
string correctly). So I believe the issue is internal to exec(),
effecting $output contents only.

As you can guess, this string is in fact serialized openvpn startup log
lines (I just escaped the single quotes for testing purposes, that's
all), it is not some manually crafted string. Therefore, it is possible
that I may get more than one similar situation in the future.

I have confirmed this issue on OpenBSD, Linux, and Windows. Here are
the versions:

OpenBSD:
PHP 5.2.8 with Suhosin-Patch 0.9.6.3 (cli) (built: Mar  1 2009
10:26:06) 
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
with Suhosin v0.9.27, Copyright (c) 2007, by SektionEins GmbH

Linux:
PHP 5.2.6-3ubuntu4.2 with Suhosin-Patch 0.9.6.2 (cli) (built: Aug 21
2009 21:43:13) 
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies

Windows:
PHP 5.2.11 (cli) (built: Sep 16 2009 19:39:46)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

Since Windows version is without Suhosin patch, suhosin as culprit is
ruled out. (Also to test on Windows, I changed the exec shell command as
'php.exe echostr.php' of course.)






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



#49847 [Ver]: exec() confused by a specially crafted string

2009-10-12 Thread Sjoerd
 ID:   49847
 Updated by:   sjo...@php.net
 Reported By:  soner at comixwall dot org
 Status:   Verified
 Bug Type: Program Execution
 Operating System: OpenBSD, Linux, Windows
 PHP Version:  5.2.11
 New Comment:

>From exec.c:125:
while (php_stream_get_line(stream, ... b, EXEC_INPUT_BUF, &bufl)) {
/* no new line found, let's read some more */
if (b[bufl - 1] != '\n' && !php_stream_eof(stream)) {
...
continue;
...
add_next_index_stringl(array, buf, bufl, 1);

php_stream_get_line reads all the data. No newline is found, because
there is none. The reading has not yet triggered php_stream_eof, because
reading has stopped just before the bytes ran out. Loop starts again.
php_stream_get_line now reads no bytes at all, because no bytes are
left. Loop quits without adding the string to the array.


Previous Comments:


[2009-10-12 19:01:54] sjo...@php.net

The trick is that the string which is output is 4095 bytes long.

exec("printf %4095d 1", $output);
print_r($output);



[2009-10-12 16:57:11] soner at comixwall dot org

Description:

When shell command returns a specially crafted string, I get an empty
array as $output of exec(), instead of the string. I can very easily
reproduce this issue, please see below for test code.

Reproduce code:
---
Put the following lines in bug.php:



Then put the contents at the following link in echostr.php:
http://comixwall.org/dmdocuments/echostr

Expected result:

When you execute bug.php, you will get an empty array printed out:

Array
(
)

Actual result:
--
Actually, $output should have contained the string above as element 0
of the array.

If you delete or add a character in the string, exec() runs correctly
and you get the intended result. So the issue is specific to this
special string.

The problem is not with the size of the string, because much longer
strings are fine.

Also this issue does *not* exists with passthru(), shell_exec()
functions and backtick operator. Furthermore, exec() return value, i.e.
the last line of shell command output seems fine too (it contains the
string correctly). So I believe the issue is internal to exec(),
effecting $output contents only.

As you can guess, this string is in fact serialized openvpn startup log
lines (I just escaped the single quotes for testing purposes, that's
all), it is not some manually crafted string. Therefore, it is possible
that I may get more than one similar situation in the future.

I have confirmed this issue on OpenBSD, Linux, and Windows. Here are
the versions:

OpenBSD:
PHP 5.2.8 with Suhosin-Patch 0.9.6.3 (cli) (built: Mar  1 2009
10:26:06) 
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
with Suhosin v0.9.27, Copyright (c) 2007, by SektionEins GmbH

Linux:
PHP 5.2.6-3ubuntu4.2 with Suhosin-Patch 0.9.6.2 (cli) (built: Aug 21
2009 21:43:13) 
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies

Windows:
PHP 5.2.11 (cli) (built: Sep 16 2009 19:39:46)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

Since Windows version is without Suhosin patch, suhosin as culprit is
ruled out. (Also to test on Windows, I changed the exec shell command as
'php.exe echostr.php' of course.)






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



#49847 [Opn->Ver]: exec() confused by a specially crafted string

2009-10-12 Thread Sjoerd
 ID:   49847
 Updated by:   sjo...@php.net
 Reported By:  soner at comixwall dot org
-Status:   Open
+Status:   Verified
 Bug Type: Program Execution
 Operating System: OpenBSD, Linux, Windows
 PHP Version:  5.2.11
 New Comment:

The trick is that the string which is output is 4095 bytes long.

exec("printf %4095d 1", $output);
print_r($output);


Previous Comments:


[2009-10-12 16:57:11] soner at comixwall dot org

Description:

When shell command returns a specially crafted string, I get an empty
array as $output of exec(), instead of the string. I can very easily
reproduce this issue, please see below for test code.

Reproduce code:
---
Put the following lines in bug.php:



Then put the contents at the following link in echostr.php:
http://comixwall.org/dmdocuments/echostr

Expected result:

When you execute bug.php, you will get an empty array printed out:

Array
(
)

Actual result:
--
Actually, $output should have contained the string above as element 0
of the array.

If you delete or add a character in the string, exec() runs correctly
and you get the intended result. So the issue is specific to this
special string.

The problem is not with the size of the string, because much longer
strings are fine.

Also this issue does *not* exists with passthru(), shell_exec()
functions and backtick operator. Furthermore, exec() return value, i.e.
the last line of shell command output seems fine too (it contains the
string correctly). So I believe the issue is internal to exec(),
effecting $output contents only.

As you can guess, this string is in fact serialized openvpn startup log
lines (I just escaped the single quotes for testing purposes, that's
all), it is not some manually crafted string. Therefore, it is possible
that I may get more than one similar situation in the future.

I have confirmed this issue on OpenBSD, Linux, and Windows. Here are
the versions:

OpenBSD:
PHP 5.2.8 with Suhosin-Patch 0.9.6.3 (cli) (built: Mar  1 2009
10:26:06) 
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
with Suhosin v0.9.27, Copyright (c) 2007, by SektionEins GmbH

Linux:
PHP 5.2.6-3ubuntu4.2 with Suhosin-Patch 0.9.6.2 (cli) (built: Aug 21
2009 21:43:13) 
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies

Windows:
PHP 5.2.11 (cli) (built: Sep 16 2009 19:39:46)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

Since Windows version is without Suhosin patch, suhosin as culprit is
ruled out. (Also to test on Windows, I changed the exec shell command as
'php.exe echostr.php' of course.)






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



#49838 [Fbk->Opn]: feof() reached end while reading big HTTP response from socket using fgets.

2009-10-12 Thread Sjoerd
 ID:   49838
 Updated by:   sjo...@php.net
 Reported By:  travian dot utils at gmail dot com
-Status:   Feedback
+Status:   Open
 Bug Type: Sockets related
 Operating System: FreeBSD 7.2-RELEASE-p4 amd64
 PHP Version:  5.2.11


Previous Comments:


[2009-10-12 11:51:32] gmc at sonologic dot nl

I'm experiencing the same problem on:

FreeBSD 7.1-PRERELEASE FreeBSD 7.1-PRERELEASE #0: Tue Oct 14 11:55:05
CEST 2008 r...@postel:/usr/obj/usr/src/sys/GENERIC  i386

The problem is that feof($fp) returns TRUE, even though the end of the
remote file has not been reached.

The below script reproduces the problem. I'm sorry it depends on an
external resource, that's just the nature of the problem. AFAICS, the
bug is not dependent on the particular file chosen, it occurs for any
large text file.

http://www.mersenneforum.org/txt/43.txt";;

if (!($fp = fopen($file, "r"))) {
die("could not open XML input from $file");
}

$chunkno=1;
$total=0;
while($data=fgets($fp,1)) {
$total+=strlen($data);
if($trigger_bug) {
  print "chunk $chunkno, total ".$total."
(+".strlen($data)."), eof: ".(feof($fp)?1:0)."\n";
} else {
  print "chunk $chunkno, total ".$total."
(+".strlen($data).")\n";
}
$chunkno++;
}
fclose($fp);

?>

With $trigger_bug set to true, this will terminate before all of the
file is read. With $trigger_bug set to false it will read the entire
file. Note that the only difference between the two is that the script
displays the output of feof($fp).

This bug started to bite us when we upgraded from 5.2.1 to 5.2.11, it
is not present in 5.2.1 / 5.1.4.



[2009-10-12 11:13:06] sjo...@php.net

Thank you for your bug report.

I don't understand the description you gave. Please make a small PHP
script to reproduce the problem and describe what the expected and
actual output are. Also, please explain exactly what is going wrong in
which PHP function.



[2009-10-11 17:13:45] travian dot utils at gmail dot com 

Corrected summary.



[2009-10-11 17:08:44] travian dot utils at gmail dot com 

Description:

feof() reached end of stream while reading big HTTP response from
socket using fgets.



Reproduce code:
---
...
  $fp = @fsockopen ($sname, 80, $errno, $errstr, 18);
  if ($fp) {
fputs ($fp, "GET /".$xxx." HTTP/1.0\r\nHost:
".$sname."\r\nUser-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0;
en-US; rv:1.9.0.2) Gecko/2008092313 Firefox/3.1.6\r\n\r\n");
$time='';
$len='';
$substr='';
$upstr='';
$redirect='';
$http_code=0;
while (!feof($fp)) {
  $line=fgets($fp,256);
  $substr=substr($line,0,15);
  $substr2=substr($line,0,10);
  $substr3=substr($line,0,16);
  if(strpos($line, '404 Not Found')!=false){$http_code=404;
break;};
  if($line==chr(13).chr(10))break;
  if($substr2=='Location: '){$redirect=substr($line,10);break;};
  if($substr3=='Content-Length: ')$len=intval(substr($line,16));
  if($substr=='Last-Modified: ')$time=substr($line,15);
}
$rlen=0;
unset($lines);
// This cycle reached end while reading big HTTP response 
while (!feof($fp)) {
  $line=fgets($fp,1024);
  $lines[]=$line;
  $rlen+=strlen($line);
}
//print('$len='.$len);
//print('$time='.$time);
$dtin=date('Y-m-d',strtotime($time));
$time=strtotime($time);
//print('$dtin='.$dtin);
//print('$time='.$time);
if($http_code==404){
  return -10;
}elseif($dtin==$dt){
  return -2;
}elseif($time==-1){
  return -3;
}elseif($redirect!=''){
  return -4;
}elseif($time==''){
  return -5;
}elseif(isset($timein)){
  if($time<=$timein){
return 0;
  }
}
  }else{
return -6;
  }
...






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



#49831 [Opn->Fbk]: zlib.output_compression

2009-10-12 Thread sjoerd
 ID:   49831
 Updated by:   sjo...@php.net
 Reported By:  jom at grosjo dot net
-Status:   Open
+Status:   Feedback
 Bug Type: *Compression related
 Operating System: Linux
 PHP Version:  5.2SVN-2009-10-10 (snap)
 New Comment:

Thank you for your explanation.

The behavior you describe may be caused by bug #49816 output corruption
using flush.

However, there are many reasons why compression may not work,
especially with large PHP applications like SugarCRM or phpMyAdmin. To
pinpoint the problem, please supply us with a small script to reproduce
the problem. Also, the HTTP headers of the page which causes garbage
would be helpful.


Previous Comments:


[2009-10-11 12:15:34] jom at grosjo dot net

Initial situation:

in php.ini: zlib.output_compression=1

This works fine except for phpMyAdmin and SugarSuiteCRM who are 
sending garbage (i.e. uncompressed instead of compressed or vice 
versa) 

The bug fix in SugarSuite is to write an ini_set with not 1 but 'true'

with the quotes ("'").
Without the quotes or by writing just 1 , the garbage comes again.

Now, I can see that putting 'true' with the quotes actually disable 
the zlib compression, this is why the garbage disappear,

but the problem is that zlib compression as well.

How to make this zlib.compression work ?

it was very fine in 5.2.9



[2009-10-10 12:13:26] sjo...@php.net

Thank you for your bug report.

I don't understand your report. Please explain clearly which settings
result in which behavior and what is wrong with it.



[2009-10-10 10:58:57] jom at grosjo dot net

Description:

Relates to bug #48994 (which I can not modify or re-open)

Actually, with the latest snapshot, the setting shall be

'true'

and NOT:

true
1

This is a real annoying bug. It makes issues in softs like SugarCRM,
phpMyAdmin, etc... which believe that 1 is true and is also 'true'

Reproduce code:
---
put 'true' in php.ini and phpMyAdmin works nicely
put true or 1 in php.ini, and the display is full of garbage


Expected result:

true, 1, 'true' shall work the same way






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



#49821 [Opn->Fbk]: unserialize of references

2009-10-12 Thread sjoerd
 ID:   49821
 Updated by:   sjo...@php.net
 Reported By:  liz2k dot b8 at gmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: *Programming Data Structures
 Operating System: linux
 PHP Version:  5.2.11
 New Comment:

I don't understand your answer. Please explain, preferably with a code
example, how the behavior you described causes a problem.


Previous Comments:


[2009-10-12 07:01:18] liz2k dot b8 at gmail dot com

no - you can try serialize(&unserialize(serialize($a))).



[2009-10-11 09:33:52] sjo...@php.net

Thank you for your bug report.

Is there a problem with this other than that the serialization string
is different? Do objects $a and $b have different behavior?



[2009-10-09 14:05:22] liz2k dot b8 at gmail dot com

And one more wrong work Example:

$a = new stdClass;
$a->v2 = &$a;
$a->v1 = $a;

echo serialize($a)."\n";

$b = &unserialize(serialize($a));

echo serialize($b);

Expected result:

O:8:"stdClass":2:{s:2:"v2";R:1;s:2:"v1";r:1;}
O:8:"stdClass":2:{s:2:"v2";R:1;s:2:"v1";r:1;}

Actual result:
--
O:8:"stdClass":2:{s:2:"v2";R:1;s:2:"v1";r:1;}
O:8:"stdClass":2:{s:2:"v2";r:1;s:2:"v1";r:1;}



[2009-10-09 13:05:44] liz2k dot b8 at gmail dot com

Description:

function unserialize return wrong result of reference

Reproduce code:
---
---
>From manual page: function.serialize
---
$a = new stdClass;
$a->v1 = $a;
$a->v2 = &$a;

echo serialize($a)."\n";

$b = &unserialize(serialize($a));

echo serialize($b);


Expected result:

O:8:"stdClass":2:{s:2:"v1";r:1;s:2:"v2";R:1;}
O:8:"stdClass":2:{s:2:"v1";r:1;s:2:"v2";R:1;}

Actual result:
--
O:8:"stdClass":2:{s:2:"v1";r:1;s:2:"v2";R:1;}
O:8:"stdClass":2:{s:2:"v1";R:1;s:2:"v2";R:1;}





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



#49838 [Opn->Fbk]: feof() reached end while reading big HTTP response from socket using fgets.

2009-10-12 Thread sjoerd
 ID:   49838
 Updated by:   sjo...@php.net
 Reported By:  travian dot utils at gmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Sockets related
 Operating System: FreeBSD 7.2-RELEASE-p4 amd64
 PHP Version:  5.2.11
 New Comment:

Thank you for your bug report.

I don't understand the description you gave. Please make a small PHP
script to reproduce the problem and describe what the expected and
actual output are. Also, please explain exactly what is going wrong in
which PHP function.


Previous Comments:


[2009-10-11 17:13:45] travian dot utils at gmail dot com 

Corrected summary.



[2009-10-11 17:08:44] travian dot utils at gmail dot com 

Description:

feof() reached end of stream while reading big HTTP response from
socket using fgets.



Reproduce code:
---
...
  $fp = @fsockopen ($sname, 80, $errno, $errstr, 18);
  if ($fp) {
fputs ($fp, "GET /".$xxx." HTTP/1.0\r\nHost:
".$sname."\r\nUser-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0;
en-US; rv:1.9.0.2) Gecko/2008092313 Firefox/3.1.6\r\n\r\n");
$time='';
$len='';
$substr='';
$upstr='';
$redirect='';
$http_code=0;
while (!feof($fp)) {
  $line=fgets($fp,256);
  $substr=substr($line,0,15);
  $substr2=substr($line,0,10);
  $substr3=substr($line,0,16);
  if(strpos($line, '404 Not Found')!=false){$http_code=404;
break;};
  if($line==chr(13).chr(10))break;
  if($substr2=='Location: '){$redirect=substr($line,10);break;};
  if($substr3=='Content-Length: ')$len=intval(substr($line,16));
  if($substr=='Last-Modified: ')$time=substr($line,15);
}
$rlen=0;
unset($lines);
// This cycle reached end while reading big HTTP response 
while (!feof($fp)) {
  $line=fgets($fp,1024);
  $lines[]=$line;
  $rlen+=strlen($line);
}
//print('$len='.$len);
//print('$time='.$time);
$dtin=date('Y-m-d',strtotime($time));
$time=strtotime($time);
//print('$dtin='.$dtin);
//print('$time='.$time);
if($http_code==404){
  return -10;
}elseif($dtin==$dt){
  return -2;
}elseif($time==-1){
  return -3;
}elseif($redirect!=''){
  return -4;
}elseif($time==''){
  return -5;
}elseif(isset($timein)){
  if($time<=$timein){
return 0;
  }
}
  }else{
return -6;
  }
...






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



#49840 [Opn]: PHP_SELF returns incorrect value

2009-10-12 Thread sjoerd
 ID:   49840
 Updated by:   sjo...@php.net
 Reported By:  lxd717 at gmail dot com
 Status:   Open
 Bug Type: PHP options/info functions
 Operating System: WINXP
 PHP Version:  5.2.11
 New Comment:

See also Bug #49825 PHP_SELF duplicate path.


Previous Comments:


[2009-10-12 03:48:35] lxd717 at gmail dot com

Actual result:
--
/confucian/η??՜ѧָ׷/test.php/confucian/???1??2?-|???/test.
php



[2009-10-12 03:47:14] lxd717 at gmail dot com

Description:

PHP_SELF returns incorrect value.
I creat a folder with chinese, the path is
'/confucian/西方哲学著作/', and then I check phpinfo(),I found
that $_SERVER['PHP_SELF'] returns incorrect value. But folders Created
in english found no errors.

Reproduce code:
---
file: test.php


The script test.php was created in a non-english folder,such as
'/confucian/西方哲学著作/'.

Expected result:

/confucian/%e8%a5%bf%e6%96%b9%e5%93%b2%e5%ad%a6%e8%91%97%e4%bd%9c/test.php
or
/confucian/西方哲学著作/test.php



Actual result:
--
/confucian/η??՜ѧָ׷/index.php/confucian/???1??2?-|???/index.php






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



#49825 [Opn->Fbk]: PHP_SELF duplicate path

2009-10-12 Thread sjoerd
 ID:   49825
 Updated by:   sjo...@php.net
 Reported By:  michaels at sc dot edu
-Status:   Open
+Status:   Feedback
 Bug Type: IIS related
 Operating System: Windows Server 2000
 PHP Version:  5.3.0
 New Comment:

See also Bug #49840 PHP_SELF returns incorrect value. Does the full
path of index.php contains non-ASCII characters?


Previous Comments:


[2009-10-09 21:02:31] michaels at sc dot edu

Description:

This issue is the same as reported in Bug #45637 but is happening with
IIS5 running on Server 2000.

The variable:

_SERVER["PHP_SELF"] /forums/adm/index.php/forums/adm/index.php

should be _SERVER["PHP_SELF"]   /forums/adm/index.php

This is causing phpBB version 3 to operate incorrectly, by providing an
incorrect connection string.

Reproduce code:
---
These are vars from the info page - please note _SERVER["PHP_SELF"]:

_SERVER["SERVER_PORT"]  80
_SERVER["SERVER_PORT_SECURE"]   0
_SERVER["SERVER_PROTOCOL"]  HTTP/1.1
_SERVER["SERVER_SOFTWARE"]  Microsoft-IIS/5.0
_SERVER["SystemDrive"]  C:
_SERVER["SystemRoot"]   C:\WINNT
_SERVER["TEMP"] C:\WINNT\TEMP
_SERVER["TMP"]  C:\WINNT\TEMP
_SERVER["USERPROFILE"]  C:\Documents and Settings\WWW\ASPNET
_SERVER["windir"]   C:\WINNT
_SERVER["SCRIPT_FILENAME"]  D:\Inetpub\phpBB3\adm\index.php
_SERVER["PHP_SELF"] /forums/adm/index.php/forums/adm/index.php
_SERVER["REQUEST_TIME"] 1255105911

Expected result:

_SERVER["PHP_SELF"] /forums/adm/index.php

Actual result:
--
_SERVER["PHP_SELF"] /forums/adm/index.php/forums/adm/index.php





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



#49819 [Opn]: STDOUT losing data with posix_isatty()

2009-10-11 Thread Sjoerd
 ID:  49819
 Updated by:  sjo...@php.net
 Reported By: cschneid at cschneid dot com
 Status:  Open
 Bug Type:Streams related
 PHP Version: 6SVN-2009-10-09 (SVN)
 New Comment:

Could reproduce with PHP 5.3-HEAD.


Previous Comments:


[2009-10-09 12:54:53] cschneid at cschneid dot com

--- sapi/cli/php_cli.c  (revision 289412)
+++ sapi/cli/php_cli.c  (working copy)
@@ -565,6 +565,10 @@
s_err->flags |= PHP_STREAM_FLAG_NO_CLOSE;
 #endif

+   s_in->flags  |= PHP_STREAM_FLAG_NO_SEEK;
+   s_out->flags |= PHP_STREAM_FLAG_NO_SEEK;
+   s_err->flags |= PHP_STREAM_FLAG_NO_SEEK;
+
s_in_process = s_in;

php_stream_to_zval(s_in,  zin);



[2009-10-09 12:50:19] cschneid at cschneid dot com

Description:

The PHP streams for stdin, stdout and stderr are seekable which results
in php_stream_flush() and seek being called on it.

For some reason php_stream_flush() fails to actually write the data
while still calling seek and resetting the stream position.

Suggested solution:
- Find out why php_stream_flush() fails and fix it (I don't know enough
about it)
- Mark (some? all?) stdio streams as PHP_STREAM_FLAG_NO_SEEK in
sapi/cli/php_cli.c (see patch)
- Mark stdio streams as PHP_STREAM_FLAG_NO_SEEK in
ext/standard/php_fopen_wrapper.c


Reproduce code:
---
php -r 'echo "hello1\n"; posix_isatty(STDOUT); echo "hello2\n";' >out;
cat out


Expected result:

hello1
hello2


Actual result:
--
hello2






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



#49821 [Opn]: unserialize of references

2009-10-11 Thread Sjoerd
 ID:   49821
 Updated by:   sjo...@php.net
 Reported By:  liz2k dot b8 at gmail dot com
 Status:   Open
 Bug Type: *Programming Data Structures
 Operating System: linux
 PHP Version:  5.2.11
 New Comment:

Thank you for your bug report.

Is there a problem with this other than that the serialization string
is different? Do objects $a and $b have different behavior?


Previous Comments:


[2009-10-09 14:05:22] liz2k dot b8 at gmail dot com

And one more wrong work Example:

$a = new stdClass;
$a->v2 = &$a;
$a->v1 = $a;

echo serialize($a)."\n";

$b = &unserialize(serialize($a));

echo serialize($b);

Expected result:

O:8:"stdClass":2:{s:2:"v2";R:1;s:2:"v1";r:1;}
O:8:"stdClass":2:{s:2:"v2";R:1;s:2:"v1";r:1;}

Actual result:
--
O:8:"stdClass":2:{s:2:"v2";R:1;s:2:"v1";r:1;}
O:8:"stdClass":2:{s:2:"v2";r:1;s:2:"v1";r:1;}



[2009-10-09 13:05:44] liz2k dot b8 at gmail dot com

Description:

function unserialize return wrong result of reference

Reproduce code:
---
---
>From manual page: function.serialize
---
$a = new stdClass;
$a->v1 = $a;
$a->v2 = &$a;

echo serialize($a)."\n";

$b = &unserialize(serialize($a));

echo serialize($b);


Expected result:

O:8:"stdClass":2:{s:2:"v1";r:1;s:2:"v2";R:1;}
O:8:"stdClass":2:{s:2:"v1";r:1;s:2:"v2";R:1;}

Actual result:
--
O:8:"stdClass":2:{s:2:"v1";r:1;s:2:"v2";R:1;}
O:8:"stdClass":2:{s:2:"v1";R:1;s:2:"v2";R:1;}





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



#49832 [Opn->Bgs]: parse_url won't parse properly a.com:::

2009-10-11 Thread Sjoerd
 ID:   49832
 Updated by:   sjo...@php.net
 Reported By:  marius dot andreiana at gmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: URL related
 Operating System: Linux
 PHP Version:  5.2.11
 New Comment:

I don't think this is a bug.

>From the documentation of parse_url:
This function is not meant to validate the given URL, it only breaks it
up into the above listed parts. Partial URLs are also accepted,
parse_url() tries its best to parse them correctly. [...] On seriously
malformed URLs, parse_url() may return FALSE and emit a E_WARNING.


Previous Comments:


[2009-10-10 18:44:42] marius dot andreiana at gmail dot com

Indeed it's not valid.
Therefore parse_url should return false, this is the bug.

Now returns: Array ( [scheme] => http [host] => a.com:: )

Expected: return false



[2009-10-10 18:06:50] sjo...@php.net

Thank you for your bug report.

Your example URL, "http://a.com:::";, does not seem valid to me. Why do
you think this URL is valid?



[2009-10-10 15:48:29] marius dot andreiana at gmail dot com

Description:

http://a.com::: 
Array ( [scheme] => http [host] => a.com:: )
expected: return false

Reproduce code:
---
$url_parts = parse_url("http://a.com:::";);
print_r($url_parts); 


Expected result:

See Description

Actual result:
--
See Description





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



#49835 [Opn->Bgs]: Counting and removing multiple attributes doesn't work

2009-10-11 Thread Sjoerd
 ID:   49835
 Updated by:   sjo...@php.net
 Reported By:  vtap at club-internet dot fr
-Status:   Open
+Status:   Bogus
 Bug Type: DOM XML related
 Operating System: Windows 7 RTM
 PHP Version:  5.3.0
 New Comment:

Thank you for your bug report.

DOMXPath->query does not return an array, but a DOMNodeList. The
count() function returns the number of elements in an array, but a
DOMNodeList is not an array. Use DOMNodeList->length instead.


Previous Comments:


[2009-10-11 07:03:39] vtap at club-internet dot fr

Found a bypass solution :

$query = "//body";
foreach ($xpath -> query($query) as $element) {
$names = array();
foreach ($element -> attributes as $attribute) {
$names[] = $attribute -> name;
}
foreach ($names as $name) {
$element -> removeAttribute($name);
}
}

ugly but it works...



[2009-10-10 23:55:23] vtap at club-internet dot fr

Description:

Trying to remove all attributes of the  tag in an HTML file. 

1/ Just counting : count is always equal to 1 whatever the real number
of attributes is (varying from 0 to 3) though the name function
retrieves all entries
2/ Removing : count is always equal to 1, only the first attribute is
removed and breaks the loop, showing only the first one. Tried
removeAttribute and removeAttributenode


Reproduce code:
---
$html = new DOMDocument();
$html -> loadHTMLFile("mypath\\myfile.html");
//Recherche du body et suppression de tous ses attributs
$xpath = new DOMXPath($html);
$query = "//body";
foreach ($xpath -> query($query) as $node) {
echo "Count before = " .
count($node-> attributes) .
"";
foreach ($node-> attributes as $attribute) {
//$node-> removeAttributenode($attribute);
echo "$attribute->name ";
//$node-> removeAttribute($attribute -> name);
}
echo "Count after = " .
count($node-> attributes) .
"";
}


Expected result:


displays (just counting)
Count before = 1
bgcolor
text
Count after= 1

displays (removing)

Count before = 1
bgcolor
Count after= 1

and gives







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



#49832 [Opn->Fbk]: parse_url won't parse properly a.com:::

2009-10-10 Thread Sjoerd
 ID:   49832
 Updated by:   sjo...@php.net
 Reported By:  marius dot andreiana at gmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: URL related
 Operating System: Linux
 PHP Version:  5.2.11
 New Comment:

Thank you for your bug report.

Your example URL, "http://a.com:::";, does not seem valid to me. Why do
you think this URL is valid?


Previous Comments:


[2009-10-10 15:48:29] marius dot andreiana at gmail dot com

Description:

http://a.com::: 
Array ( [scheme] => http [host] => a.com:: )
expected: return false

Reproduce code:
---
$url_parts = parse_url("http://a.com:::";);
print_r($url_parts); 


Expected result:

See Description

Actual result:
--
See Description





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



#49831 [Opn]: zlib.output_compression

2009-10-10 Thread Sjoerd
 ID:   49831
 Updated by:   sjo...@php.net
 Reported By:  jom at grosjo dot net
 Status:   Open
 Bug Type: *Compression related
 Operating System: Linux
 PHP Version:  5.2SVN-2009-10-10 (snap)
 New Comment:

Thank you for your bug report.

I don't understand your report. Please explain clearly which settings
result in which behavior and what is wrong with it.


Previous Comments:


[2009-10-10 10:58:57] jom at grosjo dot net

Description:

Relates to bug #48994 (which I can not modify or re-open)

Actually, with the latest snapshot, the setting shall be

'true'

and NOT:

true
1

This is a real annoying bug. It makes issues in softs like SugarCRM,
phpMyAdmin, etc... which believe that 1 is true and is also 'true'

Reproduce code:
---
put 'true' in php.ini and phpMyAdmin works nicely
put true or 1 in php.ini, and the display is full of garbage


Expected result:

true, 1, 'true' shall work the same way






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



#49829 [Opn]: ./configure --with-mysql=mysqlnd gave configure error

2009-10-10 Thread Sjoerd
 ID:   49829
 Updated by:   sjo...@php.net
 Reported By:  eddychu at yahoo dot com
 Status:   Open
 Bug Type: Compile Failure
 Operating System: CentOS 5.3
 PHP Version:  5.3.0
 New Comment:

Thank you for your bug report.

Have you installed the MySQL development files, from the mysql-devel
package?


Previous Comments:


[2009-10-10 02:12:33] eddychu at yahoo dot com

Description:

Followed http://us.php.net/manual/en/mysqlnd.install.php instructions
to attempt to configure PHP to build with mysqlnd support, but it gave
error:

configure: error: Cannot find MySQL header files under mysqlnd,.
Note that the MySQL client library is not bundled anymore!

although ext/mysqlnd folder is right there under php-5.3.0.  And no
Makefile was generated so I can't build PHP.  Either the instructions
are wrong or the configure scripts are wrong.

Reproduce code:
---
---
>From manual page: mysqlnd.install
---
Simply try to configure with mysqlnd:

./configure --with-mysql=mysqlnd, --with-mysqli=mysqlnd and
--with-pdo-mysql=mysqlnd

Expected result:

Expected ./configure --with-mysql=mysqlnd, --with-mysqli=mysqlnd and
--with-pdo-mysql=mysqlnd to successfully generate the Makefile.  If
other configure option(s) are required for these to work, they should be
mentioned in the above manual page.

Actual result:
--
configure: error: Cannot find MySQL header files under mysqlnd,.
Note that the MySQL client library is not bundled anymore!

Can't proceed further.





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



#49828 [Opn]: class-constant can't be set to negative infinity

2009-10-10 Thread Sjoerd
 ID:   49828
 Updated by:   sjo...@php.net
 Reported By:  daniel dot meister at datahouse dot ch
 Status:   Open
 Bug Type: Class/Object related
 Operating System: Ubuntu 09.04
 PHP Version:  5.2.11
 New Comment:

Could reproduce with PHP 5.2-HEAD and PHP 5.3-HEAD. The error occurs on
the line with:
const a = -INF;

Note that the same error occurs with:
const a = -(1);

Because you can't use an expression when defining a constant.


Previous Comments:


[2009-10-10 11:46:45] daniel dot meister at datahouse dot ch

possible workarounds:

define("C",-INF);
class A {
const a = C;
}

class A {
const a = -1E1;
}



[2009-10-10 00:44:03] daniel dot meister at datahouse dot ch

Description:

It is not possible to set a class-constant to the value of negative
infinity (-INF) while it is possible to set it to any float value or
even to positive infinity (INF) or not-a-number (NAN).

configuration:
- no configure options
- no changes to php.ini

Reproduce code:
---
class A {

const a = -INF;

}

echo is_infinite(A::a);


Expected result:

1

Actual result:
--
Fatal error: Unsupported operand types in /path/to/file/filename.php on
line n






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



#49827 [Opn->Fbk]: shell_exec using ls /home fails with Permission denied

2009-10-10 Thread Sjoerd
 ID:   49827
 Updated by:   sjo...@php.net
 Reported By:  bill dot mcclendon at digiconllc dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Unknown/Other Function
 Operating System: Linux RH
 PHP Version:  5.2.11
 New Comment:

Thank you for your bug report.

Does your installation have other access control than UNIX permissions,
such as ACL? Can you succesfully execute 'ls /home' from the command
line, or using backticks in PHP?


Previous Comments:


[2009-10-09 22:49:50] bill dot mcclendon at digiconllc dot com

Corrected email address (your form seems to have a problem)



[2009-10-09 22:48:30] bill dot mcclendon at digiconllc dot com

Description:

Running Apache 2.x and PHP 5.2

safe_mode = off

test case - using ""
produces the error "ls: /home Permission denied"
using "" succeeds

(check the Apache error_log for errors)

However, both "/home" and "/usr" have the EXACT same permission and
ownership.

and Apache is running with "User owner" where "owner" is the owner of
the contents of "/home".  

Listing of both paths:

  8 drwxr-xr-x   15 root   root4096 Jun 24  2005 usr
  8 drwxr-xr-x5 root   root4096 Jan  8  2007 home

Shell is "/bin/bash" and it looks like:

764 -rwxr-xr-x  1 root root 772760 Dec  6  2004 /bin/bash


Any ideas?

Reproduce code:
---
Test cases:
FAIL:

".shell_exec($cmd)."";
?>

SUCCESS:
".shell_exec($cmd)."";
?>

Expected result:

Listing of files:

SUCCESS result:

bin
etc
games
include
kerberos
lib
lib64
libexec
local
sbin
share
src
tmp
X11R6


Actual result:
--
For FAIL above (no results).





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



#49822 [Opn->Bgs]: error using mail functions

2009-10-10 Thread Sjoerd
 ID:   49822
 Updated by:   sjo...@php.net
 Reported By:  diya_pratap_malhotra at yahoo dot co dot in
-Status:   Open
+Status:   Bogus
 Bug Type: Mail related
 Operating System: Windows
 PHP Version:  5.3.0
 New Comment:

Thank you for your report.

This site, bugs.php.net, is not for requesting support but for filing
bugs in PHP. For support, please see http://www.php.net/support.php


Previous Comments:


[2009-10-09 13:12:11] diya_pratap_malhotra at yahoo dot co dot in

Description:

when using the mail() function m getting an error as the following 
---

Warning: mail() [function.mail]: Failed to connect to mailserver at
"localhost" port 25, verify your "SMTP" and "smtp_port" setting in
php.ini or use ini_set() in D:\wamp\www\mscit9\EmailSend.php on line 34

---
when i changed in php.ini even then m getting another error msg

Tell me exactly what to configure in php.ini and how to use the mail()
function to send the mail 

plzzz...


Reproduce code:
---
---
>From manual page: function.mail#Description
---







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



#49820 [Opn]: XSLTProcessor returns Error at xsl:variable with comment inside

2009-10-10 Thread Sjoerd
 ID:   49820
 Updated by:   sjo...@php.net
 Reported By:  felixsigl at gmail dot com
 Status:   Open
 Bug Type: XSLT related
 Operating System: Windows
 PHP Version:  5.3.0
 New Comment:

Thank you for your bug report.

Can you also reproduce it if you remove the whitespace between the
variable tags? In your example, the variable element would have a text
child node with some whitespace in it. Technically, this is not allowed
since the variable tag should have no content at all.


Previous Comments:


[2009-10-09 13:03:40] felixsigl at gmail dot com

Description:

I have a lot of XSL files which i want to process with the libxml
XSLTProcessor. But the XSLTProcessor returns Error at xsl:variable with
a comment inside. I don´t know exactly if this is a bug but i think so.

I know that i should use either a select attribute or child nodes in
the variable to define the variable. but shouldn´t comments be ignored
in that way?

Reproduce code:
---
the variable in the xsl file:

doesnt work!:

   


works:


works too:

   


Expected result:

transformed XML

Actual result:
--
Error 1: compilation error: file file:///C:/Programme/xampp/test01.xsl
line 4 element variable Line: 0 Column: 0 Error 1: XSLT-variable: The
must be no child nodes, since the attribute 'select' was specified.
Line: 0 Column: 0





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



#49816 [Opn->Fbk]: output corruption using flush

2009-10-08 Thread Sjoerd
 ID:   49816
 Updated by:   sjo...@php.net
 Reported By:  paul at wcclan dot net
-Status:   Open
+Status:   Feedback
 Bug Type: Output Control
 Operating System: FreeBSD 7.2-RELEASE-p4
 PHP Version:  5.2.11
 New Comment:

Thank you for bug report.

The garbage data you see in the browser is the correct page, but
compressed. The data is probably automatically compressed by Apache or
PHP, without setting the correct headers. Because the headers are not
set, the browser does not uncompress the page.

Please check your server settings and confirm this is the problem.
There may still be a bug here, in that flush() breaks gzip compression.
In that case we need some more information on how the compression is
configured.


Previous Comments:


[2009-10-08 20:06:52] paul at wcclan dot net

Description:

Looping through the output of a process opened with popen while using
flush return "garbage" in the browser. Using telnet the intended output
can be seen in (likely corrupted) chuncked encoding. Commenting out the
flush() in below code fixes the problem.

Reproduce code:
---
\r\n";
flush();
}
pclose($handle);
}
?>


Expected result:

the output of the command whois php.net

Actual result:
--
seemingly random garbage in browser. Above script available through:
http://ipv6.wcclan.net/test.php





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



#49070 [Opn->Fbk]: return object array in a webservice

2009-10-08 Thread Sjoerd
 ID:   49070
 Updated by:   sjo...@php.net
 Reported By:  jordibsala at gmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: SOAP related
 Operating System: windows xp
 PHP Version:  5.3.0
 New Comment:

Thank you for your bug report.

To properly diagnose and reproduce the problem, we need the SOAP
response from the server when it returns the array. You can obtain this
by calling __getLastRequest() or using a sniffer like Wireshark.


Previous Comments:


[2009-07-27 09:34:04] jordibsala at gmail dot com

Description:

I have a problem when I call a function of a JAVA webservice which 
returns a array of objects, but this array's objects are empty.


Reproduce code:
---
$wsdl = 
"http://localhost:8180/ContentManager/services/ContentManagerWS?wsdl";;

$contentId = "hola";
$metadataSet = 2;

$client = new SoapClient($wsdl);
$params =  array('contentId' => $contentId,'metadataSet' =>
$metadataSet);
try
{   
   $result = $client->__soapCall('getMetadata', array('parameters' =>
$params));
} catch (SoapFault $exception) {
echo $exception;
}

?>


Expected result:

object(stdClass)#2 (1) { ["getMetadataReturn"]=> object(stdClass)#3 (6)

{ ["contentID"]=> string(36) "6b9f1157-78c2-4e2d-b371-39431088" 
["raudolares"]=> int(100) ["thumbnail"]=> string(45) 
"http://www.thumbnailsraudos.es/thumbnail1.jpg"; 
["RecommendationValue"]=> int(12) ["semanticData"]=> object(stdClass)#4

(5) { ["emitDate"]=> string(10) "21/07/2009" ["filmDate"]=> string(10)

"21/05/2009" ["editDate"]=> string(10) "21/06/2009" ["edited"]=> 
bool(true) ["labeled"]=> bool(false)  } ["technicalData"]=> array(5) {

[0]=> object(stdClass)#9 (2) {["bitrate"]=> int(1024000) ["filesize"]=>

int(51236254) } [1]=> object(stdClass)#10 (2) {
["bitrate"]=>int(512000) 
["filesize"]=> int(21365245) } [2]=> NULL [3]=> NULL [4]=> NULL } } }

Actual result:
--
object(stdClass)#2 (1) { ["getMetadataReturn"]=> object(stdClass)#3 (6)

{ ["contentID"]=> string(36) "6b9f1157-78c2-4e2d-b371-39431088" 
["raudolares"]=> int(100) ["thumbnail"]=> string(45) 
"http://www.thumbnailsraudos.es/thumbnail1.jpg"; 
["RecommendationValue"]=> int(12) ["semanticData"]=> object(stdClass)#4

(5) { ["emitDate"]=> string(10) "21/07/2009" ["filmDate"]=> string(10)

"21/05/2009" ["editDate"]=> string(10) "21/06/2009" ["edited"]=> 
bool(true) ["labeled"]=> bool(false)  } ["technicalData"]=> array(5) {

[0]=> object(stdClass)#9 (0) { } [1]=> object(stdClass)#10 (0) { }
[2]=> 
NULL [3]=> NULL [4]=> NULL } } }





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



#49815 [Opn->Fbk]: Problem with imagettfbbox

2009-10-08 Thread Sjoerd
 ID:   49815
 Updated by:   sjo...@php.net
 Reported By:  christian dot roy at orange dot fr
-Status:   Open
+Status:   Feedback
 Bug Type: GD related
 Operating System: Linux
 PHP Version:  5.2.11
 New Comment:

Thank you for your bug report.

The expected and actual results in your bug report are the same. Please
describe what is wrong with the x-coordinate and what you expect.


Previous Comments:


[2009-10-08 15:07:48] christian dot roy at orange dot fr

Description:

delivered value problem : x coord are wrong.

Seems to be very similar with bug #48801 taht has been fixed in 5.2.11
for y coordinates

Reproduce code:
---
$fontPath = 'Labo/Includes/Times.ttf'; // std Times.ttf
$testChars = array( 'a', 'k', 'j' );

echo '';
foreach( $testChars as $char )
{
$dims = imagettfbbox( 60, 0, $fontPath, $char );
echo 'bbox returned rectangle for ' . $char . ' : ';
echo $dims[0]."  *  ";
echo $dims[1]."  *  ";
echo $dims[2]."  *  ";
echo $dims[3]."  *  ";
echo $dims[4]."  *  ";
echo $dims[5]."  *  ";
echo $dims[6]."  *  ";
echo $dims[7]."";
}
echo '';



Expected result:

With PHP 4.4.9 :

bbox returned rectangle for a : 2  *  1  *  35  *  1  *  35  *  -38  * 
2  *  -38

bbox returned rectangle for k : 0  *  -1  *  38  *  -1  *  38  *  -57 
*  0  *  -57

bbox returned rectangle for j : -9  *  17  *  14  *  17  *  14  *  -57 
*  -9  *  -57



Actual result:
--
With PHP 5.2.11

bbox returned rectangle for a : 2  *  1  *  35  *  1  *  35  *  -38  * 
2  *  -38

bbox returned rectangle for k : 0  *  -1  *  38  *  -1  *  38  *  -57 
*  0  *  -57

bbox returned rectangle for j : -9  *  17  *  14  *  17  *  14  *  -57 
*  -9  *  -57






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



#49226 [Fbk]: SoapServer failing on construction (cannot load wsdl)

2009-10-07 Thread Sjoerd
 ID:   49226
 Updated by:   sjo...@php.net
 Reported By:  richard at rjharrison dot org
 Status:   Feedback
 Bug Type: SOAP related
 Operating System: linux
 PHP Version:  5.3.0
 New Comment:

See also Bug #48216 PHP Fatal error: SOAP-ERROR: Parsing WSDL: Extra
content at the end of the doc


Previous Comments:


[2009-10-07 16:28:23] petro at eps1lon dot com

That should be 5.3.1RC1.



[2009-10-07 16:25:01] petro at eps1lon dot com

I was having the same problem with SoapClient under 5.3.0.  It is
working fine under 5.3.RC1.



[2009-10-01 11:37:09] sjo...@php.net

Please try using this snapshot:

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

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





[2009-09-30 18:26:54] sjo...@php.net

Evrard mailed me a HTTP trace, which I put here:
http://pastebin.com/f25b554f9

I could reproduce this with PHP 5.3, not PHP 5.3-HEAD, so this may have
already been fixed in trunk.



[2009-09-23 09:13:56] evrard at h2a dot lu

For everybody that are looking for a little fix for that, force
SoapClient to send an HTTP 1.0 request and your script may run again. It
is working for me with PHP 5.3.0, ZEND 1.9 (minimal package, via PEAR)
and APACHE 2.2.12 on Windows XP.

 array(
   'protocol_version'=> '1.0' ,
   'header'=> 'Content-Type: text/xml;' ,
 ),
   ) );

   $options = array(
 'stream_context' => $context ,
   );

   $client = new SoapClient( 'http://myserver/path?wsdl' , $options
);
}
catch( Exception $e )
{
  // You should not be here anymore
}
?>



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/49226

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



#48216 [Fbk]: PHP Fatal error: SOAP-ERROR: Parsing WSDL: Extra content at the end of the doc

2009-10-07 Thread Sjoerd
 ID:   48216
 Updated by:   sjo...@php.net
 Reported By:  mark at everytruckjob dot com
 Status:   Feedback
 Bug Type: SOAP related
 Operating System: CentOs 5.3
 PHP Version:  5.3.0RC2
 New Comment:

Please try using this snapshot:

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

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




Previous Comments:


[2009-10-07 18:29:40] sjo...@php.net

I tested using the HTTP trace Robert Ripley sent. I discovered some
things:

Libxml uses the PHP stream wrappers to load the WSDL. These stream
wrappers return a malformed WSDL to libxml. This is not specific to
SOAP. Running file_get_contents($wsdl) also returns a malformed WSDL.

It is reproducible with PHP 5.3 but not with PHP 5.3-HEAD. This
suggests that this bug has already been fixed.



[2009-10-06 17:09:14] robert dot ripley at fhchs dot edu

I'm also experiencing the same problem. Here is the HTTP header of the
WSDL:

HTTP/1.1 200 OK\r\n
Date: Tue, 06 Oct 2009 16:48:26 GMT\r\n
Server: Apache/2.2.8 (Win32) PHP/5.2.5\r\n
X-Powered-By: PHP/5.2.5\r\n
Expires: Wed, 06 Oct 2010 04:00:00 GMT\r\n
Cache-Control: no-store, no-cache, must-revalidate\r\n
Pragma: no-cache\r\n
Last-Modified: Tue, 06 Oct 2009 16:48:26 GMT\r\n
Cache-Control: post-check=0, pre-check=0\r\n
Vary: User-Agent\r\n
Keep-Alive: timeout=5, max=100\r\n
Connection: Keep-Alive\r\n
Transfer-Encoding: chunked\r\n
Content-Type: application/xml;\r\n
\r\n



[2009-09-18 16:39:44] boris dot t at usask dot ca

it seems that X-Powered-By: is causing problems. 
The same problem exists when 

HTTP/1.x 200 OK
Date: Fri, 18 Sep 2009 16:24:06 GMT
X-Powered-By: Servlet 2.4; JBoss-4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA
date=200807181417)/JBossWeb-2.0
Content-Type: text/xml;charset=utf-8
Connection: close
Transfer-Encoding: chunked
 
and the same code works when 

HTTP/1.x 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=utf-8
Transfer-Encoding: chunked
Date: Fri, 18 Sep 2009 16:23:28 GMT



[2009-09-07 20:04:53] sjo...@php.net

Thank you for your feedback.

It would be most helpful to us if you could supply us with the HTTP
transaction of the retrieval of the WSDL. You may use a sniffer like
Wireshark to obtain this information, or use this script I wrote
.



[2009-09-07 00:43:35] michael dot tibben at gmail dot com

We are experiencing a similar issue. However, the HTTP reply is using
chunked transfer encoding (Content-Length is NOT required when using
chunked)


HTTP/1.1 200 OK
Date: Sun, 06 Sep 2009 23:25:16 GMT
Server: Apache
X-Powered-By: Servlet/2.4 JSP/2.0
Transfer-Encoding: chunked
Content-Type: text/xml; charset=UTF-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/48216

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



#48216 [Opn->Fbk]: PHP Fatal error: SOAP-ERROR: Parsing WSDL: Extra content at the end of the doc

2009-10-07 Thread Sjoerd
 ID:   48216
 Updated by:   sjo...@php.net
 Reported By:  mark at everytruckjob dot com
-Status:   Open
+Status:   Feedback
 Bug Type: SOAP related
 Operating System: CentOs 5.3
 PHP Version:  5.3.0RC2
 New Comment:

I tested using the HTTP trace Robert Ripley sent. I discovered some
things:

Libxml uses the PHP stream wrappers to load the WSDL. These stream
wrappers return a malformed WSDL to libxml. This is not specific to
SOAP. Running file_get_contents($wsdl) also returns a malformed WSDL.

It is reproducible with PHP 5.3 but not with PHP 5.3-HEAD. This
suggests that this bug has already been fixed.


Previous Comments:


[2009-10-06 17:09:14] robert dot ripley at fhchs dot edu

I'm also experiencing the same problem. Here is the HTTP header of the
WSDL:

HTTP/1.1 200 OK\r\n
Date: Tue, 06 Oct 2009 16:48:26 GMT\r\n
Server: Apache/2.2.8 (Win32) PHP/5.2.5\r\n
X-Powered-By: PHP/5.2.5\r\n
Expires: Wed, 06 Oct 2010 04:00:00 GMT\r\n
Cache-Control: no-store, no-cache, must-revalidate\r\n
Pragma: no-cache\r\n
Last-Modified: Tue, 06 Oct 2009 16:48:26 GMT\r\n
Cache-Control: post-check=0, pre-check=0\r\n
Vary: User-Agent\r\n
Keep-Alive: timeout=5, max=100\r\n
Connection: Keep-Alive\r\n
Transfer-Encoding: chunked\r\n
Content-Type: application/xml;\r\n
\r\n



[2009-09-18 16:39:44] boris dot t at usask dot ca

it seems that X-Powered-By: is causing problems. 
The same problem exists when 

HTTP/1.x 200 OK
Date: Fri, 18 Sep 2009 16:24:06 GMT
X-Powered-By: Servlet 2.4; JBoss-4.2.3.GA (build: SVNTag=JBoss_4_2_3_GA
date=200807181417)/JBossWeb-2.0
Content-Type: text/xml;charset=utf-8
Connection: close
Transfer-Encoding: chunked
 
and the same code works when 

HTTP/1.x 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=utf-8
Transfer-Encoding: chunked
Date: Fri, 18 Sep 2009 16:23:28 GMT



[2009-09-07 20:04:53] sjo...@php.net

Thank you for your feedback.

It would be most helpful to us if you could supply us with the HTTP
transaction of the retrieval of the WSDL. You may use a sniffer like
Wireshark to obtain this information, or use this script I wrote
<http://www.gissen.nl/files/sniff.php>.



[2009-09-07 00:43:35] michael dot tibben at gmail dot com

We are experiencing a similar issue. However, the HTTP reply is using
chunked transfer encoding (Content-Length is NOT required when using
chunked)


HTTP/1.1 200 OK
Date: Sun, 06 Sep 2009 23:25:16 GMT
Server: Apache
X-Powered-By: Servlet/2.4 JSP/2.0
Transfer-Encoding: chunked
Content-Type: text/xml; charset=UTF-8



[2009-06-24 10:23:47] sjoerd-php at linuxonly dot nl

Thank you for your bug report.

The WSDL URL you supply does not send a Content-Length or
Transfer-Encoding header in some cases, which is mandatory in a response
with a body. In other words, it does not follow the HTTP protocol. You
should contact the provider of the WSDL about this.


GET /url HTTP/1.0
Host: example.com

HTTP/1.1 200 OK
Date: Wed, 24 Jun 2009 10:18:10 GMT
Server: Apache
Connection: close
Content-Type: text/xml

...



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/48216

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



#49789 [Opn->Bgs]: I want to make a query like this "UPDATE class=? WHERE user IN (?)"

2009-10-06 Thread sjoerd
 ID:   49789
 Updated by:   sjo...@php.net
 Reported By:  seniuk01 at yahoo dot com
-Status:   Open
+Status:   Bogus
 Bug Type: PDO related
 Operating System: IRELEVANT
 PHP Version:  5.3.0
 New Comment:

Thank you for your bug report.

The behavior you want is neither supported by prepared statements or by
PDO. Also, this is properly documented:

pdostatement.execute.php:
You cannot bind multiple values to a single parameter; for example, you
cannot bind two values to a single named parameter in an IN() clause.


Previous Comments:


[2009-10-06 14:52:49] seniuk01 at yahoo dot com

Description:

I want to make a query like this "UPDATE class=? WHERE user IN (?)"
$sth = $DBH->prepare($query);
try
{
  $sth->execute(array('class1',$an_array));
}
catch(PDOException $e)
{
  die("PDO error: ".$e->getMessage()." (".__FILE__." ".__LINE__.")");
}
So I expect this to work  but it didn't. :(

Reproduce code:
---
---
>From manual page: book.pdo
---







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



#49741 [Opn->Bgs]: I have a problem create a phar file on my system

2009-10-06 Thread sjoerd
 ID:   49741
 Updated by:   sjo...@php.net
 Reported By:  admin at sulehosting dot co dot za
-Status:   Open
+Status:   Bogus
 Bug Type: PHAR related
 Operating System: open suse 11.1
 PHP Version:  5.3.0
 New Comment:

Setting to "Bogus" because it seemed to work after all.


Previous Comments:


[2009-10-05 21:17:48] admin at sulehosting dot co dot za

It works, the phar file gets created. Thanks a lot. I am trying to go
through the changes to see what caused it to work.



[2009-10-05 11:24:38] sjo...@php.net

Could you please to run your example script again, with error reporting
enabled and check whether it works? If it does not, please provide an
strace, like this:

strace php -f foo.php 2> strace.txt

Please provide an URL to the strace here (you can use a pastebin).
Thank you.



[2009-10-05 08:45:33] admin at sulehosting dot co dot za

1)file_put_contents (works!)
$strFile = '/tmp/myFile.txt';
$strData = 'hello world';

$res = file_put_contents($strFile, $strData);

if($res):
print 'it works';
else:
print 'it failed';
endif;

2)uname -a
Linux pegasus 2.6.27.29-0.1-pae #1 SMP 2009-08-15 17:53:59 +0200 i686
i686 i386 GNU/Linux



[2009-10-03 18:45:34] f...@php.net

Could you please verify that writing to /tmp works at all (for example
file_put_contents() in the same script) and also say if it's 32bit or
64bit



[2009-10-02 11:59:35] admin at sulehosting dot co dot za

I tried setting phar.readonly to false, I no longer get the exception
but there is still no phar created on the specified directory.



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/49741

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



#49781 [Opn->Fbk]: stream_get_meta_data seeks past http headers

2009-10-06 Thread sjoerd
 ID:   49781
 Updated by:   sjo...@php.net
 Reported By:  marques at displague dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Streams related
 Operating System: linux
 PHP Version:  5.2.11
 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-10-05 19:59:08] marques at displague dot com

Description:

stream_get_meta_data will set the seek pointer in the buffer to some 
point past the headers.  The result is that if you want to use 
stream_filter_prepend or stream_filter_append (after examining the meta

data) your first bucket will contain data after the meta data (HTTP 
headers) and some of the initial content.

While trying to implement a chunked stream filter for PHP < 5.3.1 I 
experienced this.  The first bucket begins just after the hex chunklen

of the second chunk.  Switching to an fgets() loop on the headers (and

stopping at the first empty line)  corrects this.






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



#49782 [Opn->Fbk]: MSIE crashes when using output buffering

2009-10-06 Thread sjoerd
 ID:   49782
 Updated by:   sjo...@php.net
 Reported By:  office at sopadvert dot com
-Status:   Open
+Status:   Feedback
 Bug Type: *General Issues
 Operating System: Linux
 PHP Version:  5.3.0
 New Comment:

Did you also file bug 48813? What version of PHP and MSIE are you
using? Does the CPU peak at the client or at the server? Does this
happen with all pages? How often does this happen?


Previous Comments:


[2009-10-06 11:17:06] sjo...@php.net

Duplicate of Bug #48813: used ob_start() and CPU usage become 100%



[2009-10-06 11:15:23] sjo...@php.net

Note that bugs.php.net is not a place to ask for support. It is a place
to file bugs in PHP.
See also: http://www.php.net/support.php



[2009-10-05 21:15:44] office at sopadvert dot com

Description:


I have some minor problems on my website www.sopadvert.com. I have
tried to use:
ob_start(); #at the starting of the script

and

ob_flush();
ob_end_clean(); # at the end of the script

and all seems to work ok. But going to the next page and trying to go
back in internet explorer, the CPU goes nuts sometimes at 100%, while IE
crashes.
This is the only place where we use ob_start() or ob_flush(). 

What should we do?







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



#49782 [Opn]: MSIE crashes when using output buffering

2009-10-06 Thread sjoerd
 ID:   49782
 Updated by:   sjo...@php.net
 Reported By:  office at sopadvert dot com
 Status:   Open
 Bug Type: *General Issues
 Operating System: Linux
 PHP Version:  5.3.0
 New Comment:

Duplicate of Bug #48813: used ob_start() and CPU usage become 100%


Previous Comments:


[2009-10-06 11:15:23] sjo...@php.net

Note that bugs.php.net is not a place to ask for support. It is a place
to file bugs in PHP.
See also: http://www.php.net/support.php



[2009-10-05 21:15:44] office at sopadvert dot com

Description:


I have some minor problems on my website www.sopadvert.com. I have
tried to use:
ob_start(); #at the starting of the script

and

ob_flush();
ob_end_clean(); # at the end of the script

and all seems to work ok. But going to the next page and trying to go
back in internet explorer, the CPU goes nuts sometimes at 100%, while IE
crashes.
This is the only place where we use ob_start() or ob_flush(). 

What should we do?







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



#49782 [Opn]: MSIE crashes when using output buffering

2009-10-06 Thread sjoerd
 ID:   49782
 Updated by:   sjo...@php.net
 Reported By:  office at sopadvert dot com
 Status:   Open
 Bug Type: *General Issues
 Operating System: Linux
 PHP Version:  5.3.0
 New Comment:

Note that bugs.php.net is not a place to ask for support. It is a place
to file bugs in PHP.
See also: http://www.php.net/support.php


Previous Comments:


[2009-10-05 21:15:44] office at sopadvert dot com

Description:


I have some minor problems on my website www.sopadvert.com. I have
tried to use:
ob_start(); #at the starting of the script

and

ob_flush();
ob_end_clean(); # at the end of the script

and all seems to work ok. But going to the next page and trying to go
back in internet explorer, the CPU goes nuts sometimes at 100%, while IE
crashes.
This is the only place where we use ob_start() or ob_flush(). 

What should we do?







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



#49770 [Opn]: Thread Deadlocking Under Load

2009-10-05 Thread Sjoerd
 ID:   49770
 Updated by:   sjo...@php.net
 Reported By:  wickham at affl dot com
 Status:   Open
 Bug Type: Reproducible crash
 Operating System: Windows Server 2003
 PHP Version:  5.2SVN-2009-10-04 (snap)
 New Comment:

http://bugs.mysql.com/bug.php?id=12071#c48469


Previous Comments:


[2009-10-04 23:53:06] wickham at affl dot com

Here is an updated comment by the Microsoft Engineer:

I managed to find public symbols for the version of PHP you have - this
has allowed me to trace the stack back further.

The deadlocking threads look like this:

ChildEBP RetAddr
0d0bd44c 7c827d29 ntdll!KiFastSystemCallRet 0d0bd450 7c83d266
ntdll!NtWaitForSingleObject+0xc 0d0bd48c 7c83d2b1
ntdll!RtlpWaitOnCriticalSection+0x1a3
0d0bd4ac 77bcb7a9 ntdll!RtlEnterCriticalSection+0xa8
0d0bd4bc 77bbf35d msvcrt!_lock+0x30
0d0bd4f8 77bbe1f0 msvcrt!_alloc_osfhnd+0x27 0d0bd530 77bbe303
msvcrt!_creat+0x52
0d0bd564 0203fee8 msvcrt!_dup+0x55
0d0bd580 0203da08 php5ts!php_stream_gzopen+0xc8
0d0bf5b8 01e7ce6b php5ts!zif_gzfile+0x68
0d0bf614 01e83105 php5ts!zend_do_fcall_common_helper_SPEC+0x7ab
0d0bf634 01e7c635 php5ts!ZEND_DO_FCALL_SPEC_CONST_HANDLER+0xe5
0d0bf684 01e7cf8a php5ts!execute+0x1c5
0d0bf6d0 01e83105 php5ts!zend_do_fcall_common_helper_SPEC+0x8ca
0d0bf6f0 01e7c635 php5ts!ZEND_DO_FCALL_SPEC_CONST_HANDLER+0xe5
0d0bf740 01e62e87 php5ts!execute+0x1c5
0d0bf778 01f1d30d php5ts!zend_execute_scripts+0x107
0d0bf944 10001f10 php5ts!php_execute_script+0x20d 0d0bfe40 5a322991
php5isapi!HttpExtensionProc+0x110 0d0bfe60 5a3968ff
w3isapi!ProcessIsapiRequest+0x214
0d0bfe94 5a3a66f1 w3core!W3_ISAPI_HANDLER::IsapiDoWork+0x3fd
0d0bfeac 5a394c6f w3core!W3_ISAPI_HANDLER::OnCompletion+0x7e
0d0bfec4 5a394bf0 w3core!W3_HANDLER::MainOnCompletion+0x52
0d0bfee8 5a394baf w3core!W3_CONTEXT::ExecuteHandlerCompletion+0x23
0d0bff08 5a394fab w3core!W3_MAIN_CONTEXT::DoWork+0x91
0d0bff20 5a3618b2 w3core!W3_MAIN_CONTEXT::OnIoCompletion+0x37
0d0bff38 5a361650 w3dt!UL_NATIVE_REQUEST::DoStateProcess+0x48
0d0bff48 5a3616ca w3dt!UL_NATIVE_REQUEST::DoWork+0x7f
0d0bff5c 5a3024ce w3dt!OverlappedCompletionRoutine+0x1a
0d0bff8c 5a3026ac w3tp!THREAD_POOL_DATA::ThreadPoolThread+0x73
0d0bffa0 5a301da9 w3tp!THREAD_POOL_DATA::ThreadPoolThread+0x24
0d0bffb8 77e6482f w3tp!THREAD_MANAGER::ThreadManagerThread+0x39
0d0bffec  kernel32!BaseThreadStart+0x34

And this:

ChildEBP RetAddr
00fbd3b8 7c827d29 ntdll!KiFastSystemCallRet 00fbd3bc 7c83d266
ntdll!NtWaitForSingleObject+0xc
00fbd3f8 7c83d2b1 ntdll!RtlpWaitOnCriticalSection+0x1a3
00fbd418 77bbf3f4 ntdll!RtlEnterCriticalSection+0xa8
00fbd454 77bc02f3 msvcrt!_alloc_osfhnd+0xbe
00fbd484 77bc0480 msvcrt!_mktemp+0x266
00fbd4d0 01f2cb81 msvcrt!_open+0x2d
00fbd4f8 01f2ccf0 php5ts!_php_stream_fopen+0xc1 00fbd520 01f30003
php5ts!php_plain_files_stream_opener+0xa0
00fbd554 0203feb8 php5ts!_php_stream_open_wrapper_ex+0xc3
00fbd580 0203da08 php5ts!php_stream_gzopen+0x98
00fbf5b8 01e7ce6b php5ts!zif_gzfile+0x68
00fbf614 01e83105 php5ts!zend_do_fcall_common_helper_SPEC+0x7ab
00fbf634 01e7c635 php5ts!ZEND_DO_FCALL_SPEC_CONST_HANDLER+0xe5
00fbf684 01e7cf8a php5ts!execute+0x1c5
00fbf6d0 01e83105 php5ts!zend_do_fcall_common_helper_SPEC+0x8ca
00fbf6f0 01e7c635 php5ts!ZEND_DO_FCALL_SPEC_CONST_HANDLER+0xe5
00fbf740 01e62e87 php5ts!execute+0x1c5
00fbf778 01f1d30d php5ts!zend_execute_scripts+0x107
00fbf944 10001f10 php5ts!php_execute_script+0x20d 00fbfe40 5a322991
php5isapi!HttpExtensionProc+0x110 00fbfe60 5a3968ff
w3isapi!ProcessIsapiRequest+0x214
00fbfe94 5a3a66f1 w3core!W3_ISAPI_HANDLER::IsapiDoWork+0x3fd
00fbfeac 5a394c6f w3core!W3_ISAPI_HANDLER::OnCompletion+0x7e
00fbfec4 5a394bf0 w3core!W3_HANDLER::MainOnCompletion+0x52
00fbfee8 5a394baf w3core!W3_CONTEXT::ExecuteHandlerCompletion+0x23
00fbff08 5a394fab w3core!W3_MAIN_CONTEXT::DoWork+0x91
00fbff20 5a3618b2 w3core!W3_MAIN_CONTEXT::OnIoCompletion+0x37
00fbff38 5a361650 w3dt!UL_NATIVE_REQUEST::DoStateProcess+0x48
00fbff48 5a3616ca w3dt!UL_NATIVE_REQUEST::DoWork+0x7f
00fbff5c 5a3024ce w3dt!OverlappedCompletionRoutine+0x1a
00fbff8c 5a3026ac w3tp!THREAD_POOL_DATA::ThreadPoolThread+0x73
00fbffa0 5a301da9 w3tp!THREAD_POOL_DATA::ThreadPoolThread+0x24
00fbffb8 77e6482f w3tp!THREAD_MANAGER::ThreadManagerThread+0x39
00fbffec  kernel32!BaseThreadStart+0x34

In trying to poke around the local variables for things like filename
and such I was receiving a lot of memory access errors due to the
addresses being passed falling well under 0x.  This is a guard
value - any address lower than this is automatically invalid.

0:033> kn
 # ChildEBP RetAddr
00 0d0bd44c 7c827d29 ntdll!KiFastSystemCallRet
01 0d0bd450 7c83d266 ntdll!NtWaitForSingleObject+0xc
02 0d0bd48c 7c83d2b1 ntdll!RtlpWaitOnCriticalSection+0x1a3
03 0d0bd4ac 77bcb7a9 ntdll!RtlEnterCriticalSection+0xa8
04 0d0bd4bc 77bbf35d msvcrt!_lock+0x30
05 0d0bd4f8 77bbe1f0 msvcrt!_alloc_osfhnd+0x27
06 0d0bd530 77bbe303 msvcrt!_creat+0x52

#49778 [Opn]: DateInterval::format("%a") is always zero

2009-10-05 Thread Sjoerd
 ID:   49778
 Updated by:   sjo...@php.net
 Reported By:  jenwelsh at yahoo dot com
 Status:   Open
 Bug Type: Date/time related
 Operating System: Solaris 10
 PHP Version:  5.3.0
-Assigned To:  
+Assigned To:  derick
 New Comment:

Derick, how would you solve this?


Previous Comments:


[2009-10-05 16:29:44] sjo...@php.net

Thank you for your bug report.

Days is indeed not set when creating a DateInterval using the
constructor. A complication with this is that it is impossible to
determine the number of days when months or years are specified, since
these vary in length. It is possible to fill in the days field in some
cases and leave it 0 in others. In any case, it should be documented
that the days field is not always available.



[2009-10-05 14:37:27] jenwelsh at yahoo dot com

DateInterval::format with %a format does work if the DateInterval is
the result of getting the difference between two DateTime objects:

$d1=date_create('2009-11-02');
$d2=date_create('2009-11-09');
$i=$d2->diff($d1);

echo $i->format("%d");//7
echo $i->format("%a");//7



[2009-10-05 14:32:08] jenwelsh at yahoo dot com

Description:

DateInterval cannot output the total days. It always outputs 0.

Reproduce code:
---
---
>From manual page: dateinterval.format#Return Values
---

$i=new DateInterval('P7D');
print_r($i);
echo $i->format("%d");
echo $i->format("%a");

Expected result:

DateInterval Object
(
[y] => 0
[m] => 0
[d] => 7
[h] => 0
[i] => 0
[s] => 0
[invert] => 0
[days] => 0
)
7
7

Actual result:
--
DateInterval Object
(
[y] => 0
[m] => 0
[d] => 7
[h] => 0
[i] => 0
[s] => 0
[invert] => 0
[days] => 0
)
7
0





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



#49778 [Opn]: DateInterval::format("%a") is always zero

2009-10-05 Thread Sjoerd
 ID:   49778
 Updated by:   sjo...@php.net
 Reported By:  jenwelsh at yahoo dot com
 Status:   Open
 Bug Type: Date/time related
 Operating System: Solaris 10
 PHP Version:  5.3.0
 New Comment:

Thank you for your bug report.

Days is indeed not set when creating a DateInterval using the
constructor. A complication with this is that it is impossible to
determine the number of days when months or years are specified, since
these vary in length. It is possible to fill in the days field in some
cases and leave it 0 in others. In any case, it should be documented
that the days field is not always available.


Previous Comments:


[2009-10-05 14:37:27] jenwelsh at yahoo dot com

DateInterval::format with %a format does work if the DateInterval is
the result of getting the difference between two DateTime objects:

$d1=date_create('2009-11-02');
$d2=date_create('2009-11-09');
$i=$d2->diff($d1);

echo $i->format("%d");//7
echo $i->format("%a");//7



[2009-10-05 14:32:08] jenwelsh at yahoo dot com

Description:

DateInterval cannot output the total days. It always outputs 0.

Reproduce code:
---
---
>From manual page: dateinterval.format#Return Values
---

$i=new DateInterval('P7D');
print_r($i);
echo $i->format("%d");
echo $i->format("%a");

Expected result:

DateInterval Object
(
[y] => 0
[m] => 0
[d] => 7
[h] => 0
[i] => 0
[s] => 0
[invert] => 0
[days] => 0
)
7
7

Actual result:
--
DateInterval Object
(
[y] => 0
[m] => 0
[d] => 7
[h] => 0
[i] => 0
[s] => 0
[invert] => 0
[days] => 0
)
7
0





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



#49741 [Opn->Fbk]: I have a problem create a phar file on my system

2009-10-05 Thread sjoerd
 ID:   49741
 Updated by:   sjo...@php.net
 Reported By:  admin at sulehosting dot co dot za
-Status:   Open
+Status:   Feedback
 Bug Type: PHAR related
 Operating System: open suse 11.1
 PHP Version:  5.3.0
 New Comment:

Could you please to run your example script again, with error reporting
enabled and check whether it works? If it does not, please provide an
strace, like this:

strace php -f foo.php 2> strace.txt

Please provide an URL to the strace here (you can use a pastebin).
Thank you.


Previous Comments:


[2009-10-05 08:45:33] admin at sulehosting dot co dot za

1)file_put_contents (works!)
$strFile = '/tmp/myFile.txt';
$strData = 'hello world';

$res = file_put_contents($strFile, $strData);

if($res):
print 'it works';
else:
print 'it failed';
endif;

2)uname -a
Linux pegasus 2.6.27.29-0.1-pae #1 SMP 2009-08-15 17:53:59 +0200 i686
i686 i386 GNU/Linux



[2009-10-03 18:45:34] f...@php.net

Could you please verify that writing to /tmp works at all (for example
file_put_contents() in the same script) and also say if it's 32bit or
64bit



[2009-10-02 11:59:35] admin at sulehosting dot co dot za

I tried setting phar.readonly to false, I no longer get the exception
but there is still no phar created on the specified directory.



[2009-10-02 11:37:40] sjo...@php.net

Thank you for your bug report.

Please try setting phar.readonly to false. Does this solve the problem?



[2009-10-01 20:57:16] admin at sulehosting dot co dot za

Description:

I am trying to create a phar file, following examples from the php.net
http://us.php.net/manual/en/phar.using.object.php



Reproduce code:
---


and 




Expected result:

I expect a phar file to be created in the tmp directory,

Actual result:
--
UnexpectedValueException: creating archive "/tmp/first.phar" disabled
by INI setting in /srv/www/htdocs/PHAR/test_phar.php on line 2

Call Stack:
0.0003 323772   1. {main}()
/srv/www/htdocs/PHAR/test_phar.php:0
0.0003 328724   2. Phar->__construct()
/srv/www/htdocs/PHAR/test_phar.php:2

php --ri Phar

Phar

Phar: PHP Archive support => enabled
Phar EXT version => 2.0.0-dev
Phar API version => 1.1.1
CVS revision => $Revision: 1.370.2.62 $
Phar-based phar archives => enabled
Tar-based phar archives => enabled
ZIP-based phar archives => enabled
gzip compression => enabled
bzip2 compression => enabled
OpenSSL support => enabled


Phar based on pear/PHP_Archive, original concept by Davey Shafik.
Phar fully realized by Gregory Beaver and Marcus Boerger.
Portions of tar implementation Copyright (c) 2003-2009 Tim Kientzle.
Directive => Local Value => Master Value
phar.readonly => On => On
phar.require_hash => On => On
phar.cache_list => no value => no value






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



#49759 [Opn]: socket_read() fails to return empty string

2009-10-04 Thread Sjoerd
 ID:   49759
 Updated by:   sjo...@php.net
 Reported By:  chmod3 at googlemail dot com
 Status:   Open
 Bug Type: Sockets related
 Operating System: WinVista & FreeBSD
 PHP Version:  5.3.0
 New Comment:

socket_read() intentionally blocks until there is some data.


Previous Comments:


[2009-10-04 09:42:15] chmod3 at googlemail dot com

So is socket_read() supposed to hang by design when in PHP_BINARY_READ
mode when there is no more data to read?



[2009-10-03 14:14:53] chmod3 at googlemail dot com

Yes your code works only if PHP_NORMAL_READ is added. Adding
PHP_BINARY_READ or ommiting either will make it hang. I was hoping to
use binary so my script will handle the /r/n

CODE


$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
$connection = socket_connect($socket, 'news.giganews.com', 119);

do {
  echo "-- START READ\n";
  $recv = socket_read($socket, 512, PHP_NORMAL_READ);
  var_dump($recv);
  echo "-- END READ\n";
} while ($recv !== '' && $recv !== FALSE && $recv !== "\n");



[2009-10-03 13:46:07] f...@php.net

I think your example code makes no sense.

When I change it a bit, it works as expected (Did you check PHP_BINARY
READ vs. PHP_NORMAL_READ?)




I do agree that the docs could be clarified.



[2009-10-03 12:42:42] chmod3 at googlemail dot com

Description:

According to documentation:

"Note: socket_read() returns a zero length string ("") when there is no
more data to read."

This does not seem to be the case on my installations:
PHP 5.3.0 WinVista
PHP 5.2.11 WinVista
PHP 5.2.11 FreeBSD
PHP 5.2.10 WinVista
PHP 5.2.9 WinVista

socket_read() just hangs.

Reproduce code:
---
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
$connection = socket_connect($socket, 'news.giganews.com', 119);

$response = '';
do {
  $recv = '';
  echo "START READ\n";
  $recv = socket_read($socket, 512);
  echo "END READ\n";
  var_dump($recv);
  if($recv != '') {
$response .= $recv;
  }
} while($recv != '');

echo 'OUTPUT: ' . $reply;

Expected result:

START READ
END READ
string(23) "200 News.GigaNews.Com
"
START READ
END READ
OUTPUT: 200 News.GigaNews.Com

Actual result:
--
START READ
END READ
string(23) "200 News.GigaNews.Com
"
START READ





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



#49719 [Opn->Ver]: ReflectionClass::hasProperty returns true for a private property in base class

2009-10-04 Thread Sjoerd
 ID:   49719
 Updated by:   sjo...@php.net
 Reported By:  atblock at gmail dot com
-Status:   Open
+Status:   Verified
 Bug Type: Reflection related
 Operating System: Linux
 PHP Version:  5.3SVN-2009-09-30 (snap)
 New Comment:

You are right. It can be expected that if hasProperty('a') returns
true, getProperty('a') works. This works correctly when reflecting on A,
but not when reflecting on B.

Actual:
Reflect on:  A B
hasProperty: y y
getProperty: y n

I am not sure what the expected behavior should be. I.e. whether
hasProperty should return true or false on B.


Previous Comments:


[2009-10-01 12:22:31] atblock at gmail dot com

1) Because it's a member of the base class and it's private.
2) Because the equivalent $ref->getProperty('a') throws an error, of 
unknown property



[2009-10-01 11:20:59] sjo...@php.net

>From the documentation of hasMethod(), it seems that private properties
also count as properties. Why do you think this is a bug? Because the
property is not defined in class B but in class A?



[2009-09-30 01:23:41] atblock at gmail dot com

Description:

I have a class which inherits from another class. The base class has a

private property. When I check if that property exists on the inherited

class, it returns true.

Reproduce code:
---
class A {
private $a;
}
class B extends A {
}
$a = new B;
$ref = new ReflectionClass($a);
var_dump($ref->hasProperty('a'));


Expected result:

bool(false)

Actual result:
--
bool(true)






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



#49758 [Opn->Bgs]: Cannot send e-mails using SMTP in Mail PEAR package.

2009-10-04 Thread Sjoerd
 ID:   49758
 Updated by:   sjo...@php.net
 Reported By:  navossoc at gmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Unknown/Other Function
 Operating System: Windows Server 2003 R2
 PHP Version:  5.2.11
 New Comment:

Thank you for your bug report.

If there is a bug here, it is in a PEAR package and should be filed
there:
http://pear.php.net/package/Mail

Also, note that the $to variable in your example is not set.


Previous Comments:


[2009-10-03 00:16:10] navossoc at gmail dot com

Description:

Cannot send e-mails using SMTP in PEAR Mail package.

Reproduce code:
---
PEAR Mail Package:
http://pear.php.net/package/Mail

 "localhost",
"host" => "localhost",
"auth" => false
)
);

$headers = array
(
"From" => "tes...@testing.com ",
"Subject" => "some subject",
"To" => "some...@something.com",
"Content-Type" => "text/html; charset=iso-8859-1",
"MIME-Version" => "1.0"
);

$smtp->send($to, $headers, "message");
?>

Expected result:

Send the e-mail using the class without problems.

IIS 6 with PHP 5.2.11 no additional extensions.
STMP is provided by MailEnable 3.61

Actual result:
--
Don't show any error on php, between the e-mail is not send.
I can send it using mail() function without problems.

Downgrading to 5.2.10, works fine again, no code changes.





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



#44597 [Opn]: [PATCH] Postgres driver does not prepare booleans correctly

2009-10-04 Thread Sjoerd
 ID:   44597
 Updated by:   sjo...@php.net
 Reported By:  kenaniah at gmail dot com
 Status:   Open
 Bug Type: PDO related
 Operating System: Red Hat 4.1.1
 PHP Version:  5.2.6
 New Comment:

It is a bad idea to determine the PDO type from the PHP type.

First, it would break existing scripts which assume false is cast to an
empty string, like this:
$a[] = strstr($foo, $bar); // may return false
$pdo->execute($a);

Secondly, the correct type to use is the type of the column, not the
type of the PHP parameter. Consider the following query:
SELECT * FROM foo WHERE a=?
If a is a boolean, the parameter to execute() or bindBaram() should be
converted to a boolean, no matter what the type of the passed parameter
is.

Finally, one of PHP features is that it dynamically changes types. The
type of a variable should be transparent to the user. Therefore, the
behavior of a function should not change when it is passed another
type.

To solve this, you should always specify the PDO type. Only the
programmer knows which types the column in the query have, PHP can not
determine this automatically.


Previous Comments:


[2009-09-22 18:31:34] sjo...@php.net

Currently, every variable is assumed to be PDO_PARAM_STR. This patch
changes this to PDO_PARAM_INT or PDO_PARAM_BOOL if the passed variable
is a long or a bool, respectively.

http://www.gissen.nl/files/bug44597.patch

This may break existing scripts, which depend on false being converted
to an empty string.



[2009-09-21 19:48:55] kenaniah at gmail dot com

In response to sjoerd, this may very well be a product of bad
documentation, but that does not exclude the functional use case. One
could reasonably claim that proper detection of parameter types should
in fact be part of the functional definition of execute(). Virtually
every database interface built on top of PDO works around this boolean
"bug" and allows support for mixed content in the parameter array to a
prepared statement.

IMHO, the PDO core should therefore be no different. Whether classified
as a bug or a feature, I believe that this should still be addressed.



[2009-09-21 19:18:21] sjo...@php.net

I think this is not a bug but a limitation of execute(): it assumes the
values in the array are string. If you want it interpreted differently,
you should call bindParam() with a data_type parameter.

I filed Bug #49614 "PDOStatement::execute assumes string values in
array" to clarify the documentation.



[2009-09-13 20:55:01] kenaniah at gmail dot com

This is still reproducible on 5.3.0 paired with PG 8.x



[2009-09-13 19:08:46] ant at specialops dot ath dot cx

I can still reproduce this on PHP 5.3.0 and PostgreSQL 8.4.1.



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/44597

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



#49741 [Opn->Fbk]: I have a problem create a phar file on my system

2009-10-02 Thread sjoerd
 ID:   49741
 Updated by:   sjo...@php.net
 Reported By:  admin at sulehosting dot co dot za
-Status:   Open
+Status:   Feedback
 Bug Type: PHAR related
 Operating System: open suse 11.1
 PHP Version:  5.3.0
 New Comment:

Thank you for your bug report.

Please try setting phar.readonly to false. Does this solve the problem?


Previous Comments:


[2009-10-01 20:57:16] admin at sulehosting dot co dot za

Description:

I am trying to create a phar file, following examples from the php.net
http://us.php.net/manual/en/phar.using.object.php



Reproduce code:
---


and 




Expected result:

I expect a phar file to be created in the tmp directory,

Actual result:
--
UnexpectedValueException: creating archive "/tmp/first.phar" disabled
by INI setting in /srv/www/htdocs/PHAR/test_phar.php on line 2

Call Stack:
0.0003 323772   1. {main}()
/srv/www/htdocs/PHAR/test_phar.php:0
0.0003 328724   2. Phar->__construct()
/srv/www/htdocs/PHAR/test_phar.php:2

php --ri Phar

Phar

Phar: PHP Archive support => enabled
Phar EXT version => 2.0.0-dev
Phar API version => 1.1.1
CVS revision => $Revision: 1.370.2.62 $
Phar-based phar archives => enabled
Tar-based phar archives => enabled
ZIP-based phar archives => enabled
gzip compression => enabled
bzip2 compression => enabled
OpenSSL support => enabled


Phar based on pear/PHP_Archive, original concept by Davey Shafik.
Phar fully realized by Gregory Beaver and Marcus Boerger.
Portions of tar implementation Copyright (c) 2003-2009 Tim Kientzle.
Directive => Local Value => Master Value
phar.readonly => On => On
phar.require_hash => On => On
phar.cache_list => no value => no value






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



#49744 [Opn->Fbk]: Multi-line comment at EOF causes no output

2009-10-02 Thread sjoerd
 ID:   49744
 Updated by:   sjo...@php.net
 Reported By:  michael dot cordover+php at gmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Reproducible crash
 Operating System: Linux
 PHP Version:  5.2.11
 New Comment:

Please enable error_reporting and display_errors. Are you seeing an
error like this?

Warning: Unterminated comment starting line 9 in
/data/home/sjoerd/public_html/svnreps/test/a.php on line 9
Fatal error: fatal flex scanner internal error--end of buffer missed in
/data/home/sjoerd/public_html/svnreps/test/a.php on line 9


Previous Comments:


[2009-10-02 04:23:05] michael dot cordover+php at gmail dot com

It should be noted that the following code does not create this error.

 */



[2009-10-02 04:19:00] michael dot cordover+php at gmail dot com

Description:

An unterminated multi-line comment (i.e. /* without */) that runs to
the end of the file causes the parser to stop upon encountering certain
functions (phpinfo() and trigger_error() verified; others not checked).

This behaviour did not occur in 5.2.5 but does occur in 5.2.10

Environment:
PHP Version 5.2.10
FreeBSD [host-removed] 6.2-RELEASE-p12 FreeBSD 6.2-RELEASE-p12 #3: Tue
Apr 14 20:41:44 UTC 2009 r...@[host-removed]:/usr/obj/usr/src/sys/SERVER
i386
Build Date  Jul 2 2009 15:29:12
Configure Command   './configure'
Server API  Apache
PHP API 20041225
PHP Extension   20060613
Zend Extension  220060519
Apache Version  Apache
Apache Release  10339100
Apache API Version  19990320

Reproduce code:
---


Expected result:

HTTP 200 OK HEAD
Associated default PHP headers (Date, Connection, Proxy-Connection,
Content-Type, Server, X-Powered-By)
Body content 'Test' (content-length 4)

This result is obtained by removing the block comment opener (/*) or by
closing the block comment, even if closed AFTER ?>

Actual result:
--
HTTP 500 Internal Server Error in HEAD
Default PHP headers (Date, Connection, Proxy-Connection, Date,
Content-Type, Server, X-Powered-By)
No output (content-length 0)
No error logged by Apache
Apache does not load ErrorDocument 500

I am unfortunately not in a position to generate a backtrace (shared
hosting).





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



#49747 [Opn->Bgs]: floor() issue

2009-10-02 Thread sjoerd
 ID:   49747
 Updated by:   sjo...@php.net
 Reported By:  rajiv dot ambegaokar at oracle dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Math related
 Operating System: Windows XP
 PHP Version:  5.2.11
 New Comment:

Floating point values have a limited precision. Hence a value might 
not have the same string representation after any processing. That also
includes writing a floating point value in your script and directly 
printing it without any mathematical operations.

If you would like to know more about "floats" and what IEEE
754 is, read this:
http://docs.sun.com/source/806-3568/ncg_goldberg.html
 
Thank you for your interest in PHP.




Previous Comments:


[2009-10-02 10:27:37] rajiv dot ambegaokar at oracle dot com

Description:

Floor function not working properly.

Reproduce code:
---


Expected result:

431234

Actual result:
--
431233





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



#49244 [NoF->Ver]: [PATCH] Floating point NaN cause garbage characters

2009-10-01 Thread sjoerd
 ID:   49244
 Updated by:   sjo...@php.net
 Reported By:  ronlentjes at yahoo dot com dot au
-Status:   No Feedback
+Status:   Verified
 Bug Type: Scripting Engine problem
 Operating System: Linux Fedora 8
 PHP Version:  5.*, 6 (2009-09-20)
 Assigned To:  pajoye
 New Comment:

With the patch applied, I could not reproduce the problem anymore.
Pajoye still has problems, so it is not clear whether the patch solves
this bug.

The patch can be found here:
http://www.gissen.nl/files/bug49244.patch


Previous Comments:


[2009-09-29 01:00:00] 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-09-21 13:25:45] paj...@php.net

Can you verify why your patch does not work in trunk please? There is
still garbage. If you have a new patch, please post a link to it, the
form breaks the patch format.



[2009-09-20 10:24:28] sjo...@php.net

I can't commit things. Somebody with SVN access should apply my patch
and commit it. I've improved some things and added a testcase:

Index: ext/standard/formatted_print.c
===
--- ext/standard/formatted_print.c  (revision 288201)
+++ ext/standard/formatted_print.c  (working copy)
@@ -42,6 +42,8 @@
 #define FLOAT_PRECISION 6
 #define MAX_FLOAT_DIGITS 38
 #define MAX_FLOAT_PRECISION 40
+#define NOT_A_NUMBER "NaN"
+#define INFINITE "INF"
 
 #if 0
 /* trick to control varargs functions through cpp */
@@ -231,15 +233,15 @@

if (zend_isnan(number)) {
is_negative = (number<0);
-   php_sprintf_appendstring(buffer, pos, size, "NaN", 3, 0, 
padding,
-alignment, 
precision, is_negative, 0, always_sign);
+   php_sprintf_appendstring(buffer, pos, size, NOT_A_NUMBER,
strlen(NOT_A_NUMBER), 0, padding,
+   alignment, strlen(NOT_A_NUMBER), 
is_negative, 0, always_sign);
return;
}
 
if (zend_isinf(number)) {
is_negative = (number<0);
-   php_sprintf_appendstring(buffer, pos, size, "INF", 3, 0, 
padding,
-alignment, 
precision, is_negative, 0, always_sign);
+   php_sprintf_appendstring(buffer, pos, size, INFINITE,
strlen(INFINITE), 0, padding,
+   alignment, strlen(INFINITE), 
is_negative, 0, always_sign);
return;
}
 
Index: ext/standard/tests/strings/bug49244.phpt
===
--- ext/standard/tests/strings/bug49244.phpt(revision 0)
+++ ext/standard/tests/strings/bug49244.phpt(revision 0)
@@ -0,0 +1,8 @@
+--TEST--
+Bug #49244 (Floating point NaN cause garbage characters)
+--FILE--
+
+--EXPECT--
+NaN


----

[2009-09-01 16:34:22] garre...@php.net

sjoerd -- That fix works fine for me.

Can you commit that?


----

[2009-08-20 19:19:13] sjoerd-php at linuxonly dot nl

The problem is with calling php_sprintf_appendstring. Its 9th parameter
is not precision, it is length.

Index: ext/standard/formatted_print.c
===
--- ext/standard/formatted_print.c  (revision 287513)
+++ ext/standard/formatted_print.c  (working copy)
@@ -232,14 +232,14 @@
if (zend_isnan(number)) {
is_negative = (number<0);
php_sprintf_appendstring(buffer, pos, size, "NaN", 3, 0, 
padding,
-alignment, 
precision, is_negative, 0, always_sign);
+alignment, 3, 
is_negative, 0, always_sign);
return;
}
 
if (zend_isinf(number)) {
is_negative = (number<0);
php_sprintf_appendstring(buffer, pos, size, "INF", 3, 0, 
padding,
-alignment, 
precision, is_negative, 0, always_sign);
+alignment, 3, 
is_negative, 0, always_sign);
return;
}



The rema

#49226 [NoF->Fbk]: SoapServer failing on construction (cannot load wsdl)

2009-10-01 Thread sjoerd
 ID:   49226
 Updated by:   sjo...@php.net
 Reported By:  richard at rjharrison dot org
-Status:   No Feedback
+Status:   Feedback
 Bug Type: SOAP related
 Operating System: linux
 PHP Version:  5.3.0
 New Comment:

Please try using this snapshot:

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

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




Previous Comments:


[2009-09-30 18:26:54] sjo...@php.net

Evrard mailed me a HTTP trace, which I put here:
http://pastebin.com/f25b554f9

I could reproduce this with PHP 5.3, not PHP 5.3-HEAD, so this may have
already been fixed in trunk.



[2009-09-23 09:13:56] evrard at h2a dot lu

For everybody that are looking for a little fix for that, force
SoapClient to send an HTTP 1.0 request and your script may run again. It
is working for me with PHP 5.3.0, ZEND 1.9 (minimal package, via PEAR)
and APACHE 2.2.12 on Windows XP.

 array(
   'protocol_version'=> '1.0' ,
   'header'=> 'Content-Type: text/xml;' ,
 ),
   ) );

   $options = array(
 'stream_context' => $context ,
   );

   $client = new SoapClient( 'http://myserver/path?wsdl' , $options
);
}
catch( Exception $e )
{
  // You should not be here anymore
}
?>



[2009-09-01 08:07:04] sjo...@php.net

Bug #49397 describes the same problem, but with SoapClient.



[2009-09-01 01:00:00] 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-08-24 19:22:37] sjo...@php.net

PHP 5.3 indeed seems to request the WSDL using HTTP/1.1, I was wrong
about that, I'm sorry.

However, it works fine with other WSDLs which are sent chunked. There
seems to be something special about your setup which triggers this bug.
Could you make a dump of the HTTP transaction with a sniffer? Note that
you may have to disable the WSDL caching to force SoapServer to get the
WSDL over HTTP.



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/49226

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



#49636 [Opn->Fbk]: PHP_INT_SIZE inconsistent with pack("i")

2009-10-01 Thread sjoerd
 ID:   49636
 Updated by:   sjo...@php.net
 Reported By:  hsu at jean-david dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Strings related
 Operating System: linux
 PHP Version:  5.2.11
 New Comment:

Correct. You can assume that an PHP int is always 32 bits and use l for
pack. However, pack() is probably the wrong tool for the thing you want
to do.

The pack() function is mainly useful to interoperate with other
programs or protocols. In that case, you typically know the format and
sizes of things you want to pack.

If there were a pack format character which is exactly the size of a
PHP int, this would mean only PHP with the same int size could read it.
If you want to store and retrieve data using only PHP, you are better
off using serialize().

Is this clear, and do you consider this bug solved?


Previous Comments:


[2009-09-24 10:41:35] hsu at jean-david dot com

There is no easy way to pack a plain old php integer
This means that pack has many different format codes but none for a php
int?



[2009-09-23 07:28:36] sjo...@php.net

Thank you for your bug report.

The integer in the pack documentation and the integer in the PHP
integer documentation refer to different things. The pack integer is a
C-style int. The PHP integer is implemented in a long. These do not need
to be the same size.



[2009-09-23 01:54:13] hsu at jean-david dot com

Description:

PHP pack documentation:
i   signed integer (machine dependent size and byte order)

PHP integer documentation:
Integer size can be determined using the constant PHP_INT_SIZE

On some systems, I believe that the word "integer" will refer to
objects of different sizes, such that pack("i", _) could point to an
object of size X bytes and PHP_INT_SIZE return value Y which is
inconsistent.

/main/main.c l.1796:
REGISTER_MAIN_LONG_CONSTANT("PHP_INT_SIZE", sizeof(long),
CONST_PERSISTENT | CONST_CS);

/ext/standard/pack.c l.402-403:
php_pack(argv[currentarg++], sizeof(int), int_map,
&output[outputpos]);
outputpos += sizeof(int);

Reproduce code:
---
file_put_contents("test.bin",pack("I", 2));
var_dump(PHP_INT_SIZE === filesize("test.bin"));

Expected result:

bool(true)

Actual result:
--
bool(false)





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



#49719 [Opn->Fbk]: ReflectionClass::hasProperty returns true for a private property in base class

2009-10-01 Thread sjoerd
 ID:   49719
 Updated by:   sjo...@php.net
 Reported By:  atblock at gmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Scripting Engine problem
 Operating System: Linux
 PHP Version:  5.3SVN-2009-09-30 (snap)
 New Comment:

>From the documentation of hasMethod(), it seems that private properties
also count as properties. Why do you think this is a bug? Because the
property is not defined in class B but in class A?


Previous Comments:


[2009-09-30 01:23:41] atblock at gmail dot com

Description:

I have a class which inherits from another class. The base class has a

private property. When I check if that property exists on the inherited

class, it returns true.

Reproduce code:
---
class A {
private $a;
}
class B extends A {
}
$a = new B;
$ref = new ReflectionClass($a);
var_dump($ref->hasProperty('a'));


Expected result:

bool(false)

Actual result:
--
bool(true)






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



#49729 [Opn->Ver]: Segfault in PHP 5.3 inside preg_replace

2009-10-01 Thread sjoerd
 ID:   49729
 Updated by:   sjo...@php.net
 Reported By:  kendallb at amainhobbies dot com
-Status:   Open
+Status:   Verified
 Bug Type: Reproducible crash
 Operating System: Mac OS 10.6.1
 PHP Version:  5.3.0
 New Comment:

Could reproduce with PHP 5.3 rev 288893, MacOS X 10.5.8.

(gdb) r
Starting program: /Users/sjoerd/Sources/php-src-5.3/sapi/cli/php -e -f
/Volumes/sjoerd-nfs/public_html/svnreps/test/a.php
Reading symbols for shared libraries ++... done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0xbf7ffa7c
0x00058fed in match (eptr=0x976eca " OF BULLSHIT!!!\n  THIS"...,
ecode=0xaf07ae "_", mstart=0x976404 "'\n  THIS"..., offset_top=4,
md=0xbfffeacc, ims=0, eptrb=0x0, flags=0, rdepth=5515) at
/Users/sjoerd/Sources/php-src-5.3/ext/pcre/pcrelib/pcre_exec.c:432
432 {
(gdb) bt



#5513 0x0005ad96 in match (eptr=0x976406 "  THIS"..., ecode=0xaf07c3
"V", mstart=0x976404 "'\n  THIS"..., offset_top=4, md=0xbfffeacc, ims=0,
eptrb=0x0, flags=0, rdepth=2) at
/Users/sjoerd/Sources/php-src-5.3/ext/pcre/pcrelib/pcre_exec.c:1361
#5514 0x00059664 in match (eptr=0x976405 "\n  THIS"..., ecode=0xaf07be
"T", mstart=0x976404 "'\n  THIS"..., offset_top=2, md=0xbfffeacc, ims=0,
eptrb=0x0, flags=0, rdepth=1) at
/Users/sjoerd/Sources/php-src-5.3/ext/pcre/pcrelib/pcre_exec.c:720
#5515 0x0005a87d in match (eptr=0x976405 "\n  THIS"..., ecode=0xaf07ad
"g_", mstart=0x976404 "'\n  THIS"..., offset_top=2, md=0xbfffeacc,
ims=0, eptrb=0x0, flags=0, rdepth=0) at
/Users/sjoerd/Sources/php-src-5.3/ext/pcre/pcrelib/pcre_exec.c:1224
#5516 0x00066e97 in php_pcre_exec (argument_re=0xaf0780,
extra_data=0xbfffec3c, subject=0x976404 "'\n  THIS"..., length=6075,
start_offset=0, options=0, offsets=0x972530, offsetcount=6) at
/Users/sjoerd/Sources/php-src-5.3/ext/pcre/pcrelib/pcre_exec.c:4895
#5517 0x0006d5d6 in php_pcre_replace_impl (pce=0xaf07d0,
subject=0x976404 "'\n  THIS"..., subject_len=6075, replace_val=0x972344,
is_callable_replace=0, result_len=0xbfffee5c, limit=-1,
replace_count=0xbfffee48) at
/Users/sjoerd/Sources/php-src-5.3/ext/pcre/php_pcre.c:1040
#5518 0x0006d346 in php_pcre_replace (regex=0x972438
"/'('|{2}|[^'])*'/", regex_len=21, subject=0x976404 "'\n 
THIS"..., subject_len=6075, replace_val=0x972344, is_callable_replace=0,
result_len=0xbfffee5c, limit=-1, replace_count=0xbfffee48) at
/Users/sjoerd/Sources/php-src-5.3/ext/pcre/php_pcre.c:950
#5519 0x0006e347 in php_replace_in_subject (regex=0x9723f8,
replace=0x972344, subject=0xc0012c, result_len=0xbfffee5c, limit=-1,
is_callable_replace=0, replace_count=0xbfffee48) at
/Users/sjoerd/Sources/php-src-5.3/ext/pcre/php_pcre.c:1267
#5520 0x0006eeff in preg_replace_impl (ht=3, return_value=0x9723b8,
return_value_ptr=0x0, this_ptr=0x0, return_value_used=1,
is_callable_replace=0, is_filter=0) at
/Users/sjoerd/Sources/php-src-5.3/ext/pcre/php_pcre.c:1367
#5521 0x0006f00a in zif_preg_replace (ht=3, return_value=0x9723b8,
return_value_ptr=0x0, this_ptr=0x0, return_value_used=1) at
/Users/sjoerd/Sources/php-src-5.3/ext/pcre/php_pcre.c:1387
#5522 0x0045efd9 in zend_do_fcall_common_helper_SPEC
(execute_data=0xc00040) at zend_vm_execute.h:313
#5523 0x004645d9 in ZEND_DO_FCALL_SPEC_CONST_HANDLER
(execute_data=0xc00040) at zend_vm_execute.h:1602
#5524 0x0045e112 in execute (op_array=0x9719f0) at
zend_vm_execute.h:104
#5525 0x0042ee7e in zend_execute_scripts (type=8, retval=0x0,
file_count=3) at /Users/sjoerd/Sources/php-src-5.3/Zend/zend.c:1188
#5526 0x003b3321 in php_execute_script (primary_file=0xb7fc) at
/Users/sjoerd/Sources/php-src-5.3/main/main.c:2214
#5527 0x00507e5f in main (argc=4, argv=0xb8f0) at
/Users/sjoerd/Sources/php-src-5.3/sapi/cli/php_cli.c:1190
(gdb) 




Previous Comments:


[2009-10-01 10:37:43] f...@php.net

Not reproducible on Linux x86, so maybe Mac only.



[2009-10-01 02:00:38] kendallb at amainhobbies dot com

Description:

The following code causes a crash in PHP 5.3.0 (or 5.2.10) as supplied
by Zend Studio 7. It also causes a crash in PHP 5.3.0 as compiled by
MacPorts, so it appears to be a generic bug. 

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



#49730 [Opn]: Firebird - new PDO() returns NULL in CLI

2009-10-01 Thread sjoerd
 ID:   49730
 Updated by:   sjo...@php.net
 Reported By:  marcink86 at interia dot eu
 Status:   Open
 Bug Type: PDO related
 Operating System: Windows Vista
 PHP Version:  5.2.11
 New Comment:

See also Bug #49320 PDO returns null when SQLite connection fails


Previous Comments:


[2009-10-01 06:22:16] marcink86 at interia dot eu

Description:

I created a file test.php:



Note that there exists an alias TESTDB to *FDB file in Firebird
configuration.

When I 'run' this file in a web browser i get:
object(PDO)#1 (0) { } 
which I think is correct since after var_dump($pdo) I can retrieve
records from this database without any problem.

However, in command line ("php test.php" in cmd) var_dump($pdo) returns
NULL. Is it correct?
It causes many problems espacially in a Symfony framework (>=1.2) where
you build sql files and execute them through command line.







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



#49713 [Opn->Fbk]: global vs static usage

2009-09-30 Thread sjoerd
 ID:   49713
 Updated by:   sjo...@php.net
 Reported By:  patrickdk at patrickdk dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Scripting Engine problem
 Operating System: Ubuntu
 PHP Version:  5.2.11
 New Comment:

Thank you for your bug report.

Does this problem occur with all parse problems or just this one? Do
you have error reporting enabled? Is there something in your PHP error
log?


Previous Comments:


[2009-09-29 16:34:09] patrickdk at patrickdk dot com

Description:

the global modifier causes http 500 errors but doesn't produce any
syntax errors or other messages when used incorrectly. It's behavure
isn't documented and is described next to static that works differently.

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



#49226 [NoF]: SoapServer failing on construction (cannot load wsdl)

2009-09-30 Thread sjoerd
 ID:   49226
 Updated by:   sjo...@php.net
 Reported By:  richard at rjharrison dot org
 Status:   No Feedback
 Bug Type: SOAP related
 Operating System: linux
 PHP Version:  5.3.0
 New Comment:

Evrard mailed me a HTTP trace, which I put here:
http://pastebin.com/f25b554f9

I could reproduce this with PHP 5.3, not PHP 5.3-HEAD, so this may have
already been fixed in trunk.


Previous Comments:


[2009-09-23 09:13:56] evrard at h2a dot lu

For everybody that are looking for a little fix for that, force
SoapClient to send an HTTP 1.0 request and your script may run again. It
is working for me with PHP 5.3.0, ZEND 1.9 (minimal package, via PEAR)
and APACHE 2.2.12 on Windows XP.

 array(
   'protocol_version'=> '1.0' ,
   'header'=> 'Content-Type: text/xml;' ,
 ),
   ) );

   $options = array(
 'stream_context' => $context ,
   );

   $client = new SoapClient( 'http://myserver/path?wsdl' , $options
);
}
catch( Exception $e )
{
  // You should not be here anymore
}
?>



[2009-09-01 08:07:04] sjo...@php.net

Bug #49397 describes the same problem, but with SoapClient.



[2009-09-01 01:00:00] 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-08-24 19:22:37] sjo...@php.net

PHP 5.3 indeed seems to request the WSDL using HTTP/1.1, I was wrong
about that, I'm sorry.

However, it works fine with other WSDLs which are sent chunked. There
seems to be something special about your setup which triggers this bug.
Could you make a dump of the HTTP transaction with a sniffer? Note that
you may have to disable the WSDL caching to force SoapServer to get the
WSDL over HTTP.



[2009-08-24 17:53:22] richard at rjharrison dot org

Ok I understand your point (that the WSDL server is supposedly at fault
for not providing an HTTP 1.0 response). 

I just tested again and watched my Apache access_log. With 5.2.10, the
request is sent from SoapServer using HTTP 1.0, and the response from
the WSDL server correctly includes a content-length header (and
everything works fine).

When I test with 5.3, SoapServer sends the request using HTTP 1.1
(according to the Apache log) and the response is chunk-encoded causing
SoapServer to error.

Therefore I believe that SoapServer in 5.3 is sending an HTTP 1.1
request but is unable to process an HTTP 1.1 response.



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/49226

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



#49709 [Opn->Fbk]: PHP 4

2009-09-29 Thread sjoerd
 ID:   49709
 Updated by:   sjo...@php.net
 Reported By:  seepaultoday at yahoo dot com
-Status:   Open
+Status:   Feedback
 Bug Type: MSSQL related
 Operating System: window xp
 PHP Version:  5.2.11
 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-09-29 12:09:47] seepaultoday at yahoo dot com

Description:

Warning: mssql_connect() [function.mssql-connect]: Unable to connect to
server: .\SQLEXPRESS in C:\wamp\www\plantspecies\connections.php on line
6
Error Connecting to the .\SQLEXPRESS

Reproduce code:
---
---
>From manual page: function.mssql-connect
---


Expected result:

CONNECT TO SQLSERVER 2005






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



#47761 [Opn->Fbk]: Since 5.2.9 SoapClient no longer attempts Basic auth to retrieve a WSDL file

2009-09-29 Thread sjoerd
 ID:   47761
 Updated by:   sjo...@php.net
 Reported By:  marques at displague dot com
-Status:   Open
+Status:   Feedback
 Bug Type: SOAP related
 Operating System: *
 PHP Version:  5.2.9
 New Comment:

Thank you for your bug report.

How did you try to pass the username and password to the SOAP client?
Please try putting them in the URL, like this:
http://user:p...@www.example.com/service.wsdl


Previous Comments:


[2009-08-07 03:52:10] marques at displague dot com

One scenario, you are making your own SOAP Server service.  It is  more
difficult to write a digest auth server than it is to write a basic auth
server.  Again, consider that PHP web requests are all made as HTTP/1.0
because Chunk decoding is not handled properly (or at all) and so
Digest, which is HTTP/1.1 specific is technically not an option without
a good deal of custom coding.

Aside from that, I imagine there are just some HTTP/1.0 or Basic only
servers out there.



[2009-08-06 22:02:12] sriram dot natarajan at gmail dot com

why is there still a need to support basic authentication ? can u
kindly explain that scenario ?



[2009-03-24 13:53:48] marques at displague dot com

Description:

Since 5.2.9, SoapClient no longer attempts HTTP Basic authentication to
retrieve a wsdl file.

Prior to this version Basic was attempted and Digest was not.  Digest
should also be attempted but that is a matter for another bug.  The
SoapClient option 'authentication' has no effect on wsdl retrieval.

A work-around is to fetch the WSDL file manually or via PHP commands
within the SOAP code, but that method can be cumbersome because digest
auth code has to be written from scratch and Bug #47759 (chunk encoding)
can get in the way.







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



#49706 [Opn->Fbk]: feof() returns true before reaching end of stream

2009-09-29 Thread sjoerd
 ID:   49706
 Updated by:   sjo...@php.net
 Reported By:  alex at innovacomputing dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Streams related
 Operating System: Debian 5.0.3/amd64
 PHP Version:  5.2.11
 New Comment:

Please try using this snapshot:

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

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




Previous Comments:


[2009-09-29 07:21:28] tantaoui at gmail dot com

It works correctly for me in 5.2.10 but not in 5.2.11 under Windows
Server 2003. it seems to be OK in 5.2.12 (snapshot)



[2009-09-29 06:20:08] alex at innovacomputing dot com

Description:

feof() seems to have broken on socket streams somewhere between version
5.2.9 and 5.2.11.

When running the code included in this bug report on PHP 5.2.9, it
returns "bool(false)", which is the correct behavior.  However, when
upgrading to PHP 5.2.11, feof() will incorrectly return "bool(true)".

Note that I've only been able to reproduce this on a 64-bit server. 
PHP 5.2.11 on the 32-bit server that I've also tested with correctly
returns "bool(false)".

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



#49684 [Opn->Fbk]: Warning: Unknown: failed to open stream: No such file or directory in Unknown o

2009-09-28 Thread sjoerd
 ID:   49684
 Updated by:   sjo...@php.net
 Reported By:  alexbatko at gmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Scripting Engine problem
 Operating System: Mac OS X 10.6.1
 PHP Version:  5.3.0
 New Comment:

Thank you for your bug report.

A syscall trace using strace, dtrace or dtruss can help to determine
which file PHP tries to open and what the system calls return.

Please try to reproduce the problem on the command line, like
php -f testscript.php
If that gives the problem, you can try
dtruss php -f testscript.php
Please upload the resulting log somewhere and insert a link here.


Previous Comments:


[2009-09-27 21:53:22] alexbatko at gmail dot com

I did the comparison myself, on another machine, and libphp5.so had the
same size and md5.



[2009-09-26 22:20:16] alexbatko at gmail dot com

Can someone on Mac OS X 10.6.1, running the built-in PHP 5.3.0 (cli)
(built: Jul 19 2009 00:34:29), please run these commands for the sake of
comparison?

ls -l /usr/libexec/apache2/libphp5.so
-rwxr-xr-x  1 root  wheel  29081072 Jul 19 00:35
/usr/libexec/apache2/libphp5.so

md5 /usr/libexec/apache2/libphp5.so
MD5 (/usr/libexec/apache2/libphp5.so) =
7117168f74cca3f5669c26a136321712



[2009-09-26 21:55:07] alexbatko at gmail dot com

Description:

Everything was working fine, then, out of the blue, after a page
reload, I have been continuously presented with the following errors:

[Sat Sep 26 14:12:12 2009] [error] [client 127.0.0.1] PHP Warning: 
Unknown: failed to open stream: No such file or directory in Unknown on
line 0

[Sat Sep 26 14:12:12 2009] [error] [client 127.0.0.1] PHP Fatal error: 
Unknown: Failed opening required '/path/to/script/here.php'
(include_path='.:/usr/lib/php') in Unknown on line 0

PHP 5.3.0 (cli) (built: Jul 19 2009 00:34:29) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies

HTTP Server version: Apache/2.2.11 (Unix)
HTTP Server built:   May 18 2009 12:37:03

This bug seems to be the same as one submitted in 2007:

http://bugs.php.net/bug.php?id=40068

But that bug was closed - so I could not add to it - hence why I'm
opening a new one.

Reproduce code:
---
This problem occurred out of the blue. It is completely unrelated to my
code.

Expected result:

The page/code should load normally, 100% of the time.

Actual result:
--
As of the first time the error appeared (again, I emphasize: out of the
blue), I am only ever presented with the above mentioned errors... and
no PHP script is ever executed.





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



#49687 [Opn->Fbk]: utf8_decode xml_utf8_decode vuln

2009-09-28 Thread sjoerd
 ID:   49687
 Updated by:   sjo...@php.net
 Reported By:  sird at rckc dot at
-Status:   Open
+Status:   Feedback
 Bug Type: *Unicode Issues
 Operating System: *
 PHP Version:  5.2.11
 New Comment:

Is this a bug in PHP or in scripts which do utf8_decode(addslashes())
instead of addslashes(utf8_decode())? What do you propose to solve this
bug?


Previous Comments:


[2009-09-27 11:20:30] sird at rckc dot at

Description:

Taken from: http://bugs.php.net/bug.php?id=48230
> 
> Description:
> 
> xml_utf8_decode function incorrectly decode.
> 
> Reproduce code:
> ---
>  $ill=chr(0xf0).chr(0xc0).chr(0xc0).chr(0xa7);
> $ill=addslashes($ill);
> echo utf8_decode("$ill");
> echo htmlspecialchars ($ill,ENT_QUOTES,"utf-8" );
> ?>
> 
> Expected result:
> 
> it will output a "'" incorrectly.
> 
> Actual result:
> --
> it will output a "'" incorrectly.


This is actually a PHP security vulnerability.

Timeline:
* Reported by r...@80sec.com: May 11
* Discovered by webmas...@lapstore.de: June 19
* Discovered by Giorgio Maone / Eduardo Vela: July 14
* Reported and Fixed on PHPIDS: July 14
* Microsoft notified of a XSS Filter bypass: July 14
* Fixed XSS Filter bypass on NoScript 1.9.6:  July 20
* Vulnerability disclosed on BlackHat USA 2009: July 29
* Added signature to Acunetix WVS: August 14

References:
*
http://www.blackhat.com/presentations/bh-usa-09/VELANAVA/BHUSA09-VelaNava-FavoriteXSS-SLIDES.pdf
*
http://www.acunetix.com/blog/web-security-articles/security-risks-associated-with-utf8_decode/
* http://us2.php.net/manual/en/function.utf8-decode.php#83935
* http://bugs.php.net/bug.php?id=48230
* http://noscript.net/changelog

Read the references for further details.

Reproduce code:
---


Expected result:

? or 1=1-- -

Actual result:
--
' or 1=1--





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



#49701 [Opn]: rand always returns min value

2009-09-28 Thread sjoerd
 ID:   49701
 Updated by:   sjo...@php.net
 Reported By:  applezinc at gmail dot com
 Status:   Open
 Bug Type: Math related
 Operating System: slackware linux 12.2
 PHP Version:  5.2.11
 New Comment:

Thank you for your bug report.

The techical reason this works like this is as follows: rand() takes
two integers. When you specify a number bigger than 2^31, it is cast to
float. When it is passed to rand(), it is cast to an int. The number
4294967294 then becomes -2.


Previous Comments:


[2009-09-28 17:31:31] applezinc at gmail dot com

Description:

getrandmax is 2^31.

if you put in a number for max greater than that (as the documentation
says you can), the function always returns the min.

mt_rand is the same.

Reproduce code:
---
echo rand(1,4294967294);
echo "\n";
echo getrandmax();
echo "\n";


Expected result:

random number between 1 and 4294967294.

Actual result:
--
1





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



#48717 [Opn]: Cannot pass datatype long (> 2147483647) in SOAP requests

2009-09-28 Thread sjoerd
 ID:   48717
 Updated by:   sjo...@php.net
 Reported By:  rob at zcore dot org
 Status:   Open
 Bug Type: SOAP related
 Operating System: Debian GNU/Linux
 PHP Version:  5.2.11
 New Comment:

To properly diagnose this bug, we need the SOAP request and response.
You can get that using a sniffer (Wireshark) or using __getLastRequest
and __getLastResponse. See the PHP manual for information on these
methods.


Previous Comments:


[2009-09-28 08:19:22] smashles at gmail dot com

I experience a similar issue on latest FreeBSD+Apache-2.2.13+PHP5.2.11
whiling passing longint to a postgresql. When passing a number larger
then maxint, it's reduced to 2147483647.



[2009-09-27 12:14:11] rob at zcore dot org

Hi,

in the meantime my company upgraded to 5.2.11 (security reasons); the
bug seems to be in there, too.

Unluckily updating to HEAD is no option, since we are using the
ZendPlatform.

Regs
  Rob



[2009-09-25 17:23:01] persiancity at gmail dot com

another note:
I get corrent result sends from a server using PHP 5.2.42
Incorrect result sends from a server with PHP 5.2.9



[2009-09-25 17:20:18] persiancity at gmail dot com

I am not pro in SOAP so maybe provide me __getLastRequest/Response
testing code?



[2009-09-25 16:51:46] sjo...@php.net

I can not reproduce it with PHP 5.2 HEAD. Can you check with a sniffer,
or with __getLastRequest/Response if the error also occurs in the
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/48717

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



#49702 [Opn->Bgs]: I have access to the private attributes of a give class

2009-09-28 Thread sjoerd
 ID:   49702
 Updated by:   sjo...@php.net
 Reported By:  vito_web at yahoo dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Class/Object related
 Operating System: Linux
 PHP Version:  5.3.0
 New Comment:

Thank you for your report.

The behavior you describe is not a bug. The statement
$obj2->private = "Hacked";
does not change the private property of MyClass. Instead, it creates a
new public property on MyClass2.



Previous Comments:


[2009-09-28 18:25:04] vito_web at yahoo dot com

private = "Hacked";
echo $obj2->private; // should be fatal error by accessing the private

property, but it displays the string "Hacked"

?>



[2009-09-28 18:11:35] vito_web at yahoo dot com

Description:

public;
echo $this->protected;
echo $this->private;
}
}

$obj = new MyClass();
echo $obj->public; // Works
//echo $obj->protected; // Fatal Error
//echo $obj->private; // Fatal Error
$obj->printHello(); // Shows Public, Protected and Private


/**
 * Define MyClass2
 */
class MyClass2 extends MyClass
{
// We can redeclare the public and protected method, but not 
private
protected $protected = 'Protected2';

function printHello()
{
echo $this->public;
echo $this->protected;
echo $this->private;
}
}

$obj2 = new MyClass2();
echo $obj2->public; // Works
echo $obj2->private = "Hacked";
echo $obj2->private; // Undefined
//echo $obj2->protected; // Fatal Error
$obj2->printHello(); // Shows Public, Protected2, Undefined

?>

Expected result:

PHP Fatal error:  Cannot access private property MyClass2::$private 
in..

Actual result:
--
PublicPublicProtectedPrivatePublicHackedHackedPublicProtected2Hacked





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



#49698 [Opn]: Unexpected change in strnatcasecmp()

2009-09-28 Thread sjoerd
 ID:   49698
 Updated by:   sjo...@php.net
 Reported By:  sander dot vink at procurios dot nl
 Status:   Open
 Bug Type: Strings related
 Operating System: Linux
 PHP Version:  5.2.11
 New Comment:

This seems to be solved already in PHP 5.3-HEAD.


Previous Comments:


[2009-09-28 07:56:04] sander dot vink at procurios dot nl

Description:

We use the strnatcasecmp()-function to get a "natural order" in our 
lists of items. Up until PHP 5.2.9 it worked like a charm, but since we

upgraded to PHP 5.2.11 the order seems to have been changed.

The natural order is used in our case to support the sorting of items 
that have been prefixed with numbers (0, 1, 2, etc). This is exactly 
where the problem arises: 0 should be "sorted" before 1, but this is no

longer the case.

This problem also occurs in the latest snapshot of PHP 5.3

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



#48717 [Opn]: Cannot pass datatype long (> 2147483647) in SOAP requests

2009-09-25 Thread sjoerd
 ID:   48717
 Updated by:   sjo...@php.net
 Reported By:  rob at zcore dot org
 Status:   Open
 Bug Type: SOAP related
 Operating System: Debian GNU/Linux
 PHP Version:  5.2.10
 New Comment:

I can not reproduce it with PHP 5.2 HEAD. Can you check with a sniffer,
or with __getLastRequest/Response if the error also occurs in the
request?


Previous Comments:


[2009-09-25 16:42:45] persiancity at gmail dot com

I have the same problem ( http://bugs.php.net/bug.php?id=49669 ) but
float replacement not working!



[2009-07-15 14:18:50] rob at zcore dot org

Sorry, this one is way t dirty.



[2009-07-14 13:59:07] ghostbaer at gmx dot de

Hi,

a very dirty workaround is to download the wsdl an rewrite it locally
to another datatype. Changing this line:



to



should work at least. But it's a very, very, VERY, VERY, VEWY, VEWY,
VEWYVEWYVEWY dirty workaround and you'll got to hell for this or even
worse!



[2009-06-29 11:06:13] rob at zcore dot org

Description:

For some reason

Array
(
[0] => dummy Object
(
[id] => 10047678003
[pass] => XxX
)

)

is transformed to


http://schemas.xmlsoap.org/soap/envelope/";
xmlns:ns1="http://impl.ejb.flog.zcore.org/";>
  

  2147483647
  XxX

  


while it's based on this XSD snipplet:










Expected result:

http://schemas.xmlsoap.org/soap/envelope/";
xmlns:ns1="http://impl.ejb.flog.zcore.org/";>
  

  10047678003
  XxX

  


Actual result:
--
http://schemas.xmlsoap.org/soap/envelope/";
xmlns:ns1="http://impl.ejb.flog.zcore.org/";>
  

  2147483647
  XxX

  






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



#49643 [Bgs]: Improper quoting on datetime bound parameters for postgresql

2009-09-25 Thread sjoerd
 ID:   49643
 Updated by:   sjo...@php.net
 Reported By:  alandsidel at dnsstuff dot com
 Status:   Bogus
 Bug Type: PDO related
 Operating System: FreeBSD
 PHP Version:  5.3.0
 New Comment:

It is poorly documented. See also:

Bug #49614 PDOStatement::execute assumes string values in array


Previous Comments:


[2009-09-23 15:09:32] alandsidel at dnsstuff dot com

Is that documented somewhere?  I don't see it on the
PDOStatement::execute page nor the PDO::prepare page.



[2009-09-23 15:05:37] sjo...@php.net

Thank you for your report.

The behavior you describe is not a bug. PDOStatement->execute() assumes
the values in the array are string. Furthermore, you pass a string in
the array. The result is that the value is escaped as it was a string.
This means that it is quoted.



[2009-09-23 12:21:51] alandsidel at dnsstuff dot com

Description:

Running PostGreSQL 8.4, given a simple table like:

When using a bound parameter in prepare (named or unnamed) to a
timestamp field, the parameter is improperly quoted resulting in errors
on INSERT or UPDATE statements that are using expressions rather than
simple datetime strings.

Reproduce code:
---
// In the postgresql database
CREATE TABLE foo
(
  id SERIAL UNIQUE NOT NULL,
  dtSometime TIMESTAMP WITH TIME ZONE NOT NULL
);

// Assuming $dbh is a connection to the above database
if ($stmt = $dbh->prepare('INSERT INTO foo (dtSometime) VALUES
(:dtsometime)')
{
  if ($stmt->execute(array('now() + interval \'1 year\''))
  {
print("ok!\n");
  }
  else
  {
print_r($dbh->errorInfo());
  }
}

Expected result:

Expect a row to be inserted and 'ok!' to print.

Actual result:
--
The following is printed on the console:
//--cut
(   
[0] => 0
[1] => 7
[2] => ERROR:  invalid input syntax for type timestamp with time
zone: "now() + interval '1 year'"
)
//--cut

A direct insert with the given SQL works fine as expected, so this must
be a quoting issue that is forcing postgresql to interpret the
expression as a literal datetime.





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



#49668 [Opn->Fbk]: httpd2-prefore segfault error 4 mod_php5.so

2009-09-25 Thread sjoerd
 ID:   49668
 Updated by:   sjo...@php.net
 Reported By:  patrick dot shanahan at gmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Apache2 related
 Operating System: linux
 PHP Version:  5.3.0
 New Comment:

Can you reproduce the crash?


Previous Comments:


[2009-09-25 14:00:20] patrick dot shanahan at gmail dot com

last nite was really night before last

expected result s/b: an operable web server



[2009-09-25 13:54:54] patrick dot shanahan at gmail dot com

Description:

Last nite my apache2 server stopped:
  
cat /var/log/apache2/error_log  
  
[Thu Sep 24 00:17:01 2009] [notice] seg fault or similar nasty error
detected in the parent process
   

16:09 wahoo:~ # rcapache2 start 
Starting httpd2 (prefork)  failed  

dmesg: 

[14891.859160] httpd2-prefork[11030]: segfault at 8 ip 7f216093c09d
sp 7fff3e55b648 error 4 in mod_php5.so[7f21606fc000+2a8000] 
 
google search yields nothing pertinent.


disabling php5 apache2 module allows the server to start   

  
apache2-2.2.13-1.6.x86_64 
apache2-mod_php5-5.3.0-1.2.x86_64 
apache2-prefork-2.2.13-1.6.x86_64  
apache2-worker-2.2.13-1.6.x86_64  
php5-5.3.0-1.2.x86_64  
   

Reproduce code:
---
enable module php5 in apache2
restart/reload apache2

Expected result:

[14891.859160] httpd2-prefork[11030]: segfault at 8 ip
7f216093c09d
sp 7fff3e55b648 error 4 in mod_php5.so[7f21606fc000+2a8000] 

Actual result:
--
[14891.859160] httpd2-prefork[11030]: segfault at 8 ip
7f216093c09d
sp 7fff3e55b648 error 4 in mod_php5.so[7f21606fc000+2a8000] 





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



#49669 [Opn->Bgs]: SOAP pass incorrect number for long type

2009-09-25 Thread sjoerd
 ID:   49669
 Updated by:   sjo...@php.net
 Reported By:  persiancity at gmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: SOAP related
 Operating System: Linux
 PHP Version:  5.2.11
 New Comment:

Thank you for your bug report.

This problem has already been reported to the bug tracker by someone
else.

Open:
Bug #48717 Cannot pass datatype long (> 2147483647) in SOAP requests

Other:
Bug #40099 Cannot pass long (> 2147483647) in SOAP requests
Bug #30045 Cannot pass big integers (> 2147483647) in SOAP requests



Previous Comments:


[2009-09-25 15:06:33] persiancity at gmail dot com

I should add that I also tried converting to string:
 
$result = $this->client->register_number((string)$value); 
 
with no chance.



[2009-09-25 15:04:13] persiancity at gmail dot com

Description:

I use a SoapClient code to send a number to mysql database on a service
server. The field type with bug is xsd:long. when I pass a integer value
larger than 2147483647 to this field I get inccorect value on the
service server database (All numbers = 2147483647).
 
I get correct result when send data from a 64bit server and inccorect
result when send from 32bit server. but I am not sure it is cause of
server type. I have not access to soap service server to know what is
it.

Reproduce code:
---
$value= 3147483647;
$result = $this->client->register_number((int)$value); // result in
database is: 2147483647 !!
 
// the mysql database field type is unsigned bigint

Expected result:

result in database is: 2147483647 !!






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



#49666 [Opn->Bgs]: DomElement setAttribute() invalid charater

2009-09-25 Thread sjoerd
 ID:   49666
 Updated by:   sjo...@php.net
 Reported By:  ralph at bean-it dot nl
-Status:   Open
+Status:   Bogus
 Bug Type: DOM XML related
 Operating System: Windows
 PHP Version:  5.3.0
 New Comment:

Thank you for your report.

The behavior you describe is not a bug. XML attributes can not contain
spaces and can not start with a number. See the XML spec for more
information:
http://www.w3.org/TR/REC-xml/#attdecls


Previous Comments:


[2009-09-25 10:09:12] ralph at bean-it dot nl

Description:

An invalid character error is raised when I want to set an attribute on

a DomElement.

When I put my code in a try ... catch everything works fine

Reproduce code:
---
$doc = new DOMDocument('1.0', 'iso-8859-1');
$node = $doc->createElement('test');
$newnode = $doc->appendChild($node);
$newnode->setAttribute("name application", "MyApp");

Raises an error

$newnode->setAttribute("0001", "File");
Also raises an error


Expected result:

The attribute is set on my DomElement

Actual result:
--
'DOMException' with message 'Invalid Character Error'





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



  1   2   3   >