#50736 [NEW]: Fatal error: Call to undefined function mysql_drop_db()

2010-01-13 Thread ntsc279 at hotmail dot com
From: ntsc279 at hotmail dot com
Operating system: WinXP
PHP version:  5.3.1
PHP Bug Type: MySQL related
Bug description:  Fatal error: Call to undefined function mysql_drop_db()

Description:

I used Apache2.2, PHP5.3.01, MySQL5.0

I connect to DB and used function mysql_drop_db.

Program show error:
Fatal error: Call to undefined function mysql_drop_db()

I think's it error in load lib for mysql


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



#50736 [Opn-Bgs]: Fatal error: Call to undefined function mysql_drop_db()

2010-01-13 Thread pajoye
 ID:   50736
 Updated by:   paj...@php.net
 Reported By:  ntsc279 at hotmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: MySQL related
 Operating System: WinXP
 PHP Version:  5.3.1
 New Comment:

Install the mysql extension correctly.


Previous Comments:


[2010-01-13 09:10:57] ntsc279 at hotmail dot com

Description:

I used Apache2.2, PHP5.3.01, MySQL5.0

I connect to DB and used function mysql_drop_db.

Program show error:
Fatal error: Call to undefined function mysql_drop_db()

I think's it error in load lib for mysql






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



#50737 [NEW]: stream_set_blocking creates high cpu usage

2010-01-13 Thread jason at lentink dot net
From: jason at lentink dot net
Operating system: Linux
PHP version:  5.2.12
PHP Bug Type: Sockets related
Bug description:  stream_set_blocking creates high cpu usage

Description:

When using stream_set_blocking on a stream will create a huge load on 
cpu. When using this function it uses up to 50% of the cpu. When not 
using this function it will only use 0.1% cpu usage.

Reproduce code:
---
$this-_socket = fsockopen($str, $port, $errno, $errstr);
stream_set_blocking($this-_socket, 0); // non blocking

Expected result:

An socket which will be opened fast. in a non-blocking mode.

Actual result:
--
An open socket. But the cpu use is enormous.

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



#50735 [Opn-Bgs]: feature request

2010-01-13 Thread jani
 ID:   50735
 Updated by:   j...@php.net
 Reported By:  h dot riepma at gmail dot com
-Status:   Open
+Status:   Bogus
 Bug Type: Unknown/Other Function
 Operating System: ubuntu
 PHP Version:  5.2.12
 New Comment:

Please, go away troll elsewhere. And you can already do that if you
know what you're doing.


Previous Comments:


[2010-01-13 02:18:24] h dot riepma at gmail dot com

yes i know theres a logic error there...

?
__autoload($n){
 if(!function_exists('functions/'.$n)) require_once('functions/'.$n);
}
n_md5('test');
?



[2010-01-13 02:15:31] h dot riepma at gmail dot com

Description:

not a bug, but http://www.php.net/sitemap.php said to put features here
too...

would love to have __autoload effect functions as well as classes...

Reproduce code:
---
?
__autoload($n){
 if(!function_exists($n)) require_once('functions/'.$n);
}
n_md5('test');
?

Expected result:

functions/n_md5 required automatically and ran as normal

Actual result:
--
Fatal error: Call to undefined function n_md5() in
/var/www/autoload.php on line 5





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



#50737 [Opn-Fbk]: stream_set_blocking creates high cpu usage

2010-01-13 Thread jani
 ID:   50737
 Updated by:   j...@php.net
 Reported By:  jason at lentink dot net
-Status:   Open
+Status:   Feedback
-Bug Type: Sockets related
+Bug Type: Streams related
 Operating System: Linux
 PHP Version:  5.2.12
 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 ?php and ends 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:


[2010-01-13 09:58:52] jason at lentink dot net

Description:

When using stream_set_blocking on a stream will create a huge load on 
cpu. When using this function it uses up to 50% of the cpu. When not 
using this function it will only use 0.1% cpu usage.

Reproduce code:
---
$this-_socket = fsockopen($str, $port, $errno, $errstr);
stream_set_blocking($this-_socket, 0); // non blocking

Expected result:

An socket which will be opened fast. in a non-blocking mode.

Actual result:
--
An open socket. But the cpu use is enormous.





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



#50732 [Opn-Asn]: exec() adds single byte twice to $output array

2010-01-13 Thread jani
 ID:   50732
 Updated by:   j...@php.net
 Reported By:  scope at planetavent dot de
-Status:   Open
+Status:   Assigned
 Bug Type: Program Execution
-Operating System: Linux, Windows
+Operating System: *
-PHP Version:  5.3.1
+PHP Version:  5.*, 6
-Assigned To:  
+Assigned To:  iliaa
 New Comment:

Ilia, fix the fix please? (all branches of course)


Previous Comments:


[2010-01-12 22:00:28] scope at planetavent dot de

Of course, this applies as well to output that just ends with a newline
followed by a single byte.

Example:

#!/bin/sh
echo Hello\nWorl\nd

results in:

Array
(
[0] = Hello
[1] = Worl
[2] = d
[3] = d
)



[2010-01-12 19:29:26] scope at planetavent dot de

Description:

If exec is used to start a command that outputs only a single byte, and
if the $output array is used, the byte is added twice to the output
array.

Tested with php 5.3.1 in cli mode on Windows 2003 Server and Ubuntu
9.10 Server.

This behaviour was introduced with bugfix to #49847:

From exec.c:125
while (php_stream_get_line(stream, b, EXEC_INPUT_BUF, bufl)) {
...
if (b[bufl - 1] != '\n'  !php_stream_eof(stream)) {
...
continue;

If only a single byte is read, php_stream_eof(stream) returns true,
thus no second loop will take place.

After line 149:
while (l--  isspace(((unsigned char *)buf)[l]));

buflen is 1 and l is 0, therefor

line 160:
if ((type == 2  bufl  !l) || type != 2) {

yields true and the buffer is added to the output array, again.

Reproduce code:
---
?php
$command = echo x;
exec( $command, $output );
print_r( $output );

Expected result:

Array
(
[0] = x
)

Actual result:
--
Array
(
[0] = x
[1] = x
)





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



#50382 [Opn-Fbk]: garbage collection crashes

2010-01-13 Thread jani
 ID:   50382
 Updated by:   j...@php.net
 Reported By:  dirk at bean-it dot nl
-Status:   Open
+Status:   Feedback
 Bug Type: Reproducible crash
 Operating System: Debian 5.0
 PHP Version:  5.3, 6
 Assigned To:  dmitry
 New Comment:

Well, maybe you should try it and if it works, close this report? :)


Previous Comments:


[2010-01-12 15:59:57] dirk at bean-it dot nl

No crashes with version php5.3-200912310930 and --enable-debug in
./config, but I didn't get the crashes with 5.3 and --enable-debug.

The reproduce code from bug #50519 works fine now.

Still inconclusive until I can try it without --enable-debug, I guess.



[2010-01-11 10:08:56] dmi...@php.net

Please, check once again.



[2009-12-31 18:24:01] j...@php.net

You could try with --enable-debug in your configure line, Dmitry's fix
was only for debug builds.



[2009-12-31 10:58:49] dirk at bean-it dot nl

Tried php5.3-200912310930 but no luck. My PHP also still segfaults with
the reproduce code from bug #50519.



[2009-12-25 13:14:32] dmi...@php.net

The bug #50519 is fixed, however, I can't be sure that this crash is
caused by the same bug. Please check SVN 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/50382

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



#50382 [Fbk-Opn]: garbage collection crashes

2010-01-13 Thread dirk at bean-it dot nl
 ID:   50382
 User updated by:  dirk at bean-it dot nl
 Reported By:  dirk at bean-it dot nl
-Status:   Feedback
+Status:   Open
 Bug Type: Reproducible crash
 Operating System: Debian 5.0
 PHP Version:  5.3, 6
 Assigned To:  dmitry
 New Comment:

The fix only works when compiled with --enable-debug (see your comment
below). I'm happy to wait for the next 5.3.* RC of final... I'll test it
when it is available and will reopen this call when the problem still
exists.


Previous Comments:


[2010-01-13 12:38:24] j...@php.net

Well, maybe you should try it and if it works, close this report? :)



[2010-01-12 15:59:57] dirk at bean-it dot nl

No crashes with version php5.3-200912310930 and --enable-debug in
./config, but I didn't get the crashes with 5.3 and --enable-debug.

The reproduce code from bug #50519 works fine now.

Still inconclusive until I can try it without --enable-debug, I guess.



[2010-01-11 10:08:56] dmi...@php.net

Please, check once again.



[2009-12-31 18:24:01] j...@php.net

You could try with --enable-debug in your configure line, Dmitry's fix
was only for debug builds.



[2009-12-31 10:58:49] dirk at bean-it dot nl

Tried php5.3-200912310930 but no luck. My PHP also still segfaults with
the reproduce code from bug #50519.



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

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



#50382 [Opn-Csd]: garbage collection crashes

2010-01-13 Thread jani
 ID:   50382
 Updated by:   j...@php.net
 Reported By:  dirk at bean-it dot nl
-Status:   Open
+Status:   Closed
 Bug Type: Reproducible crash
 Operating System: Debian 5.0
 PHP Version:  5.3, 6
 Assigned To:  dmitry
 New Comment:

Assumed fixed - closed. Reopen if next RC (whenever that might be out,
propably next century at this pace) does not work.


Previous Comments:


[2010-01-13 12:44:49] dirk at bean-it dot nl

The fix only works when compiled with --enable-debug (see your comment
below). I'm happy to wait for the next 5.3.* RC of final... I'll test it
when it is available and will reopen this call when the problem still
exists.



[2010-01-13 12:38:24] j...@php.net

Well, maybe you should try it and if it works, close this report? :)



[2010-01-12 15:59:57] dirk at bean-it dot nl

No crashes with version php5.3-200912310930 and --enable-debug in
./config, but I didn't get the crashes with 5.3 and --enable-debug.

The reproduce code from bug #50519 works fine now.

Still inconclusive until I can try it without --enable-debug, I guess.



[2010-01-11 10:08:56] dmi...@php.net

Please, check once again.



[2009-12-31 18:24:01] j...@php.net

You could try with --enable-debug in your configure line, Dmitry's fix
was only for debug builds.



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

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



#50739 [NEW]: === could be a bit smarter with arrays...

2010-01-13 Thread zhalassy at loginet dot hu
From: zhalassy at loginet dot hu
Operating system: Irrelevant
PHP version:  5.2.12
PHP Bug Type: Arrays related
Bug description:  === could be a bit smarter with arrays...

Description:

At the moment, you can't do things like:

$GLOBALS === $GLOBALS;

or

$a = array('a' = $a); $a === $a['a'];

both causes fatal error claiming too deep nesting level.

I find it rather strange that you can use references, but you can't test
if something is referencing the same thing or not...

It would be nice to have some  or is_same($a,$b) function which
would just do a lookup in the symbol table and if the two variables
referencing the same thing it would return true, false otherwise.


Reproduce code:
---
$a = is_same($GLOBALS,$GLOBALS);

$x = array('x' = $x);
$b = is_same($x, $x['x']);

$x1 = array('c' = $x1);
$x2 = array('c' = $x2); //same layout, but not the same variable;
$c = is_same($x1,$x2);

$y1 = test;
$y2 = $y1; /* plain assignement, maybe same till y1 or y2 not changed, but
is_same() shouldn't get affected by optimization behaviour */
$d = is_same($y1,$y2);

$z1 = test2;
$z2 = $z1; //or $z2 = $z1;
$e = is_same($z1,$z2);

Expected result:

$a === true;
$b === true;
$c === false;
$d === false;
$e === true;



Actual result:
--
No way to do this ATM (AFAIK). But please tell me if i didn't read the
documentation properly...

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



#50739 [Opn-Bgs]: === could be a bit smarter with arrays...

2010-01-13 Thread jani
 ID:   50739
 Updated by:   j...@php.net
 Reported By:  zhalassy at loginet dot hu
-Status:   Open
+Status:   Bogus
 Bug Type: Arrays related
 Operating System: Irrelevant
 PHP Version:  5.2.12
 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:


[2010-01-13 12:49:42] zhalassy at loginet dot hu

Description:

At the moment, you can't do things like:

$GLOBALS === $GLOBALS;

or

$a = array('a' = $a); $a === $a['a'];

both causes fatal error claiming too deep nesting level.

I find it rather strange that you can use references, but you can't
test if something is referencing the same thing or not...

It would be nice to have some  or is_same($a,$b) function which
would just do a lookup in the symbol table and if the two variables
referencing the same thing it would return true, false otherwise.


Reproduce code:
---
$a = is_same($GLOBALS,$GLOBALS);

$x = array('x' = $x);
$b = is_same($x, $x['x']);

$x1 = array('c' = $x1);
$x2 = array('c' = $x2); //same layout, but not the same variable;
$c = is_same($x1,$x2);

$y1 = test;
$y2 = $y1; /* plain assignement, maybe same till y1 or y2 not changed,
but is_same() shouldn't get affected by optimization behaviour */
$d = is_same($y1,$y2);

$z1 = test2;
$z2 = $z1; //or $z2 = $z1;
$e = is_same($z1,$z2);

Expected result:

$a === true;
$b === true;
$c === false;
$d === false;
$e === true;



Actual result:
--
No way to do this ATM (AFAIK). But please tell me if i didn't read the
documentation properly...





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



#50722 [Opn-Fbk]: Memory corruption / SegFault with WSDL in-memory cache

2010-01-13 Thread srinatar
 ID:   50722
 Updated by:   srina...@php.net
 Reported By:  meatloafninja at gmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: SOAP related
 Operating System: CentOS 5.x
 PHP Version:  5.2.12
 New Comment:

thanks for taking time to report this issue to us. can u please try to

reproduce this issue with the latest snapshot. i am currently not able

to reproduce with the latest snapshot. 

you can get the latest snapshot php source from

http://snaps.php.net/

For Windows:

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




Previous Comments:


[2010-01-11 20:48:56] srina...@php.net

sounds similar to bug #50675 (See Also)



[2010-01-11 17:51:12] meatloafninja at gmail dot com

Description:

If you enable WSDL caching and set the cache type to 2 (memory) or 3
(both disk and memory), and create a SoapServer with a WSDL, and within
the context of that SoapServer create multiple SoapClient connections to
external web services with WSDLs (exceeding the soap.wsdl_cache_limit
setting), the SoapServer's in-memory copy of its own WSDL will get
removed / freed.

This causes a segmentation fault of the web server child process or a
corrupt / invalid XML response, as the SoapServer will be unable to
access its own WSDL when the time comes to send its response to the
original requesting client.

The SoapServer WSDL should be protected from removal.



Reproduce code:
---
?php
ini_set('soap.wsdl_cache_enabled', 1);
ini_set('soap.wsdl_cache', 3);

function test($x)
{
$client1 = new SoapClient(http://some.other.host/client1.wsdl;);
$client2 = new SoapClient(http://some.other.host/client2.wsdl;);
$client3 = new SoapClient(http://some.other.host/client3.wsdl;);
$client4 = new SoapClient(http://some.other.host/client4.wsdl;);
$client5 = new SoapClient(http://some.other.host/client5.wsdl;);

return $x; //web server segfaults or corrupt XML returned
}

$server = new SoapServer(server.wsdl);
$server-addFunction(test);
$server-handle();
?

Expected result:

A valid XML response as defined by server.wsdl.

Actual result:
--
Either a segmentation fault on the web server and a Could not fetch
HTTP headers error on the client, or a corrupted XML response.





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



#50732 [Asn-Csd]: exec() adds single byte twice to $output array

2010-01-13 Thread iliaa
 ID:   50732
 Updated by:   il...@php.net
 Reported By:  scope at planetavent dot de
-Status:   Assigned
+Status:   Closed
 Bug Type: Program Execution
 Operating System: *
 PHP Version:  5.*, 6
 Assigned To:  iliaa
 New Comment:

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.




Previous Comments:


[2010-01-13 13:44:59] s...@php.net

Automatic comment from SVN on behalf of iliaa
Revision: http://svn.php.net/viewvc/?view=revisionrevision=293502
Log: Fixed bug #50732 (exec() adds single byte twice to $output array).



[2010-01-13 12:10:43] j...@php.net

Ilia, fix the fix please? (all branches of course)



[2010-01-12 22:00:28] scope at planetavent dot de

Of course, this applies as well to output that just ends with a newline
followed by a single byte.

Example:

#!/bin/sh
echo Hello\nWorl\nd

results in:

Array
(
[0] = Hello
[1] = Worl
[2] = d
[3] = d
)



[2010-01-12 19:29:26] scope at planetavent dot de

Description:

If exec is used to start a command that outputs only a single byte, and
if the $output array is used, the byte is added twice to the output
array.

Tested with php 5.3.1 in cli mode on Windows 2003 Server and Ubuntu
9.10 Server.

This behaviour was introduced with bugfix to #49847:

From exec.c:125
while (php_stream_get_line(stream, b, EXEC_INPUT_BUF, bufl)) {
...
if (b[bufl - 1] != '\n'  !php_stream_eof(stream)) {
...
continue;

If only a single byte is read, php_stream_eof(stream) returns true,
thus no second loop will take place.

After line 149:
while (l--  isspace(((unsigned char *)buf)[l]));

buflen is 1 and l is 0, therefor

line 160:
if ((type == 2  bufl  !l) || type != 2) {

yields true and the buffer is added to the output array, again.

Reproduce code:
---
?php
$command = echo x;
exec( $command, $output );
print_r( $output );

Expected result:

Array
(
[0] = x
)

Actual result:
--
Array
(
[0] = x
[1] = x
)





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



#50675 [Opn-Fbk]: SoapClient can't handle object references correctly.

2010-01-13 Thread srinatar
 ID:   50675
 Updated by:   srina...@php.net
 Reported By:  margaritisz dot oresztesz at dotroll dot hu
-Status:   Open
+Status:   Feedback
 Bug Type: SOAP related
 Operating System: Linux
 PHP Version:  5.2.12
 New Comment:

the client.php that you attached is tar.gz of the same server side
code. 
pl.attach / provide appropriate client reproduce code 


Previous Comments:


[2010-01-06 08:46:33] margaritisz dot oresztesz at dotroll dot hu

Description:

When sending the same object multiple times in a SOAP call, SoapClient
replaces the object with a href='..' object reference. However the
client generates the request envelope with an incorrect parameter name,
so the server does not get the referenced object.

Reproduce code:
---
Sources of a simple server and client could be found at the following
URL: http://charlie.extra.hu/php-soap/soap.tar.gz

If I run client.php, it gets back an object filled with null
parameters. It should recieve the first object sent to the server.
If I change the reference's parameter name to 'secondUser', the SOAP
response includes the correct object.

Expected result:

Expected the following soap envelope to be sent:

SOAP-ENV:test
  firstUser id=ref1
userId1/userId
userNameuser/userName
  /firstUser
  secondUser href=#ref1/
/SOAP-ENV:test

Actual result:
--
Got this request:

SOAP-ENV:test
  firstUser id=ref1
userId1/userId
userNameuser/userName
  /firstUser
  firstUser href=#ref1/
/SOAP-ENV:test





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



#29005 [Com]: fopen() can't open NT named pipes on local computer

2010-01-13 Thread bob at peret dot net
 ID:   29005
 Comment by:   bob at peret dot net
 Reported By:  cleong at nflc dot org
 Status:   Open
 Bug Type: Feature/Change Request
 Operating System: Windows 2000
 PHP Version:  4.3.6
 New Comment:

I got around this by replacing the . with my local address

.\\pipe\\pipename

127.0.0.1\\pipe\\pipename


Previous Comments:


[2004-07-06 16:47:11] cleong at nflc dot org

But it's just a matter of not corrupting the filepath. This is a bug in
a way, as, for the same reason, the function cannot handle
\\.\C:\filename.ext, which is a valid Win32 path.



[2004-07-06 16:32:20] poll...@php.net

Indeed, Wez and I both have our eyes on named pipe support.  With luck
it'll show up in 5.1, in any case it should be a simple backport to make
it available to 5.0 via a PECL extension.



[2004-07-05 09:49:10] der...@php.net

Let's make this a feature request as it's currently not meant to work.



[2004-07-04 00:06:58] cleong at nflc dot org

Description:

fopen() can't handle path names like \\.\pipe\pipename because the
internal function virtual_file_ex() see the .\ part, thinks that it
means current directory, and promptly removes it.

The manual doesn't mention named pipes but I think this is worth fixing
as it will give PHP Win32 a robust interprocess communication mechanism
that's fairly easy to implement. The fix is easy enough. Insert the
following at line 413 in tsrm_virtual_cwd.c, right after the else if
(!IS_DIRECTORY_CURRENT(ptr, ptr_length)) loop:

#ifdef TSRM_WIN32
/* '.' should be retained if the first two 
chars are '\' as it
stands for local machine
   done mainly for paths to NT named pipes  
(\\.\pipe\pipename) */
} else if(state-cwd_length == 2  state-cwd[0] == 
'\\' 
state-cwd[1] == '\\') {
state-cwd = (char *) realloc(state-cwd,
state-cwd_length+ptr_length+1);
memcpy(state-cwd[state-cwd_length], ptr, 
ptr_length+1);
state-cwd_length += ptr_length;
#endif
}


Reproduce code:
---
Set break point at line 1975 in streams.c

fd = open(realpath, open_flags, 0666);

then run ? readfile('.\\pipe\\pipename'); ?. Inspect realpath.

Expected result:

realpath = \\.\pipe\pipename

Actual result:
--
realpath = \\pipe\pipename





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



#50698 [Opn-Fbk]: SoapClient should handle wsdls with some incompatiable endpoints

2010-01-13 Thread srinatar
 ID:   50698
 Updated by:   srina...@php.net
 Reported By:  zippy1981 at gmail dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Feature/Change Request
 Operating System: Windows XP/7 and probably all.
 PHP Version:  5.2.12, 5.3.1
 New Comment:

as far as I understand, Microsoft TCP transport spec is a private 
interface for communicating between .Net server/clients. I would expect

that you will need SOAP/TCP as end point for communicating between php

client and .Net server. 

Af course,my knowledge might be outdated on this. 


Previous Comments:


[2010-01-12 21:49:27] zippy1981 at gmail dot com

Verified on Windows 7 as well.



[2010-01-10 22:10:39] zippy1981 at gmail dot com

Also verified to break on 5.3.1.



[2010-01-08 21:52:35] zippy1981 at gmail dot com

I also reported this on stack overflow. If anyone has any suggestions 
for workarounds, especially if there workaround on the .NET side feel 
free to post them there.


http://stackoverflow.com/questions/1933213/connecting-to-a-wcf-service-
in-php-that-has-a-a-nettcp-binding-and-a-basichttpbin



[2010-01-08 21:19:44] zippy1981 at gmail dot com

Description:

I have a WCF web service written in .NET that has different endpoints.
I 
want .NET clients to be able to talk to it using nettcp (a propietary 
microsoft protocol) and PHP to be able to talk to it using basicHttp 
(soap 1.1). However, if WSDL contains any endpoints other than http or

https endpoints I get the following error:

PHP Fatal error:  SOAP-ERROR: Parsing WSDL: PHP-SOAP doesn't support 
transport 'http://schemas.microsoft.com/soap/tcp'

I think the following should occur:

If no endpoint is explicitly specified in the constructor, PHP should 
pick the first compatible endpoint available in the wsdl and use it. If

the endpoint is explicitly declared in the constructor, then PHP should

not care about the available endpoints.

Reproduce code:
---
?php
// .NET Service that this calls exists at
http://github.com/zippy1981/EchoService
$client = new SoapClient
('http://localhost:8731/EchoService/?wsdl',
 array(
'location' =
'http://localhost:8731/EchoService/Basic',
'trace' = true,
'soap_version' = SOAP_1_1,
'connection_timeout' = 5
)
);

echo $client-echo(array('request' = Hello World))-EchoResult;
?

Expected result:

c:\php\php.exe EchoClient.php
Hello World

Actual result:
--
PHP Fatal error:  SOAP-ERROR: Parsing WSDL: PHP-SOAP doesn't support 
transport 'http://schemas.microsoft.com/soap/tcp'





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



#50733 [Fbk-Opn]: Garbage Collection fails

2010-01-13 Thread elmex at voll dot in
 ID:   50733
 User updated by:  elmex at voll dot in
 Reported By:  elmex at voll dot in
-Status:   Feedback
+Status:   Open
 Bug Type: Session related
 Operating System: FreeBSD 6.1
 PHP Version:  5.2.12
 New Comment:

Sure, here they are (from php_info):

Session Support enabled
Registered save handlersfiles user
Registered serializer handlers  php php_binary

Directive   Local Value Master Value
session.auto_start  Off Off
session.bug_compat_42   Off Off
session.bug_compat_warn On  On
session.cache_expire180 180
session.cache_limiter   nocache nocache
session.cookie_domain   no valueno value
session.cookie_httponly Off Off
session.cookie_lifetime 0   0
session.cookie_path /   /
session.cookie_secure   Off Off
session.entropy_fileno valueno value
session.entropy_length  0   0
session.gc_divisor  10001000
session.gc_maxlifetime  14401440
session.gc_probability  1   1
session.hash_bits_per_character 5   5
session.hash_function   0   0
session.namePHPSESSID   PHPSESSID
session.referer_check   no valueno value
session.save_handlerfiles   files
session.save_path   /usr/local/www//phptmp  no value
session.serialize_handler   php php
session.use_cookies On  On
session.use_only_cookiesOff Off
session.use_trans_sid   0   0


Previous Comments:


[2010-01-12 22:07:23] der...@php.net

Can you post the other session related settings a well?



[2010-01-12 21:32:36] elmex at voll dot in

Description:

The Garbage Collection ist set to session.gc_maxlifetime=1440, but
there are a lot of session files set are older. In all hosts on the
server there is a virtual host setting for session.save_path like
session.save_path=/usr/local/www/hostname/phptmp. That is the only
session related setting, that was modified. A find for the files shows
currently:

find /usr/local/www/ -maxdepth 3 -mindepth 3 -name 'sess_*' -cmin +24 |
wc -l
8443

(amin is the same:)

find /usr/local/www/ -maxdepth 3 -mindepth 3 -name 'sess_*' -amin +24 |
wc -l
8443



Reproduce code:
---
no code, just settings

Expected result:

session files should be deleted after session.gc_maxlifetime or earlier

Actual result:
--
session files are not deleted or deleted too late





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



#50698 [Fbk-Opn]: SoapClient should handle wsdls with some incompatiable endpoints

2010-01-13 Thread zippy1981 at gmail dot com
 ID:   50698
 User updated by:  zippy1981 at gmail dot com
 Reported By:  zippy1981 at gmail dot com
-Status:   Feedback
+Status:   Open
 Bug Type: Feature/Change Request
 Operating System: Windows XP/7 and probably all.
 PHP Version:  5.2.12, 5.3.1
 New Comment:

It seems I was not clear in my original ticket.

My soap service has two end points. One is http (soap 1.1). The other 
is nettcp, microsoft private protocol.

PHP throws an error when I parse the WSDL simply because it contains 
an endpoint it can't connect to. This is in spite of the following 
four facts:

1) There is a http endpoint it knows how to connect to in the WSDL
2) I override the WSDL endpoints in the soap constructor.
3) A soap client only needs to connect to one endpoint in a WSDL to 
communicate with it

If I manually edit the WSDL so that the nettcp endpoint is no longer 
advertised, but it still exists, PHP will connect to it fine.


Previous Comments:


[2010-01-13 14:41:18] srina...@php.net

as far as I understand, Microsoft TCP transport spec is a private 
interface for communicating between .Net server/clients. I would expect

that you will need SOAP/TCP as end point for communicating between php

client and .Net server. 

Af course,my knowledge might be outdated on this. 



[2010-01-12 21:49:27] zippy1981 at gmail dot com

Verified on Windows 7 as well.



[2010-01-10 22:10:39] zippy1981 at gmail dot com

Also verified to break on 5.3.1.



[2010-01-08 21:52:35] zippy1981 at gmail dot com

I also reported this on stack overflow. If anyone has any suggestions 
for workarounds, especially if there workaround on the .NET side feel 
free to post them there.


http://stackoverflow.com/questions/1933213/connecting-to-a-wcf-service-
in-php-that-has-a-a-nettcp-binding-and-a-basichttpbin



[2010-01-08 21:19:44] zippy1981 at gmail dot com

Description:

I have a WCF web service written in .NET that has different endpoints.
I 
want .NET clients to be able to talk to it using nettcp (a propietary 
microsoft protocol) and PHP to be able to talk to it using basicHttp 
(soap 1.1). However, if WSDL contains any endpoints other than http or

https endpoints I get the following error:

PHP Fatal error:  SOAP-ERROR: Parsing WSDL: PHP-SOAP doesn't support 
transport 'http://schemas.microsoft.com/soap/tcp'

I think the following should occur:

If no endpoint is explicitly specified in the constructor, PHP should 
pick the first compatible endpoint available in the wsdl and use it. If

the endpoint is explicitly declared in the constructor, then PHP should

not care about the available endpoints.

Reproduce code:
---
?php
// .NET Service that this calls exists at
http://github.com/zippy1981/EchoService
$client = new SoapClient
('http://localhost:8731/EchoService/?wsdl',
 array(
'location' =
'http://localhost:8731/EchoService/Basic',
'trace' = true,
'soap_version' = SOAP_1_1,
'connection_timeout' = 5
)
);

echo $client-echo(array('request' = Hello World))-EchoResult;
?

Expected result:

c:\php\php.exe EchoClient.php
Hello World

Actual result:
--
PHP Fatal error:  SOAP-ERROR: Parsing WSDL: PHP-SOAP doesn't support 
transport 'http://schemas.microsoft.com/soap/tcp'





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



#50733 [Opn-Bgs]: Garbage Collection fails

2010-01-13 Thread jani
 ID:   50733
 Updated by:   j...@php.net
 Reported By:  elmex at voll dot in
-Status:   Open
+Status:   Bogus
 Bug Type: Session related
 Operating System: FreeBSD 6.1
 PHP Version:  5.2.12
 New Comment:

You just misunderstood how the GC works. Your settings mean that GC
happening has in 1/1000 chance per request. And that happens only for
session files older than 1440 seconds. No bug.


Previous Comments:


[2010-01-13 14:54:56] elmex at voll dot in

Sure, here they are (from php_info):

Session Support enabled
Registered save handlersfiles user
Registered serializer handlers  php php_binary

Directive   Local Value Master Value
session.auto_start  Off Off
session.bug_compat_42   Off Off
session.bug_compat_warn On  On
session.cache_expire180 180
session.cache_limiter   nocache nocache
session.cookie_domain   no valueno value
session.cookie_httponly Off Off
session.cookie_lifetime 0   0
session.cookie_path /   /
session.cookie_secure   Off Off
session.entropy_fileno valueno value
session.entropy_length  0   0
session.gc_divisor  10001000
session.gc_maxlifetime  14401440
session.gc_probability  1   1
session.hash_bits_per_character 5   5
session.hash_function   0   0
session.namePHPSESSID   PHPSESSID
session.referer_check   no valueno value
session.save_handlerfiles   files
session.save_path   /usr/local/www//phptmp  no value
session.serialize_handler   php php
session.use_cookies On  On
session.use_only_cookiesOff Off
session.use_trans_sid   0   0



[2010-01-12 22:07:23] der...@php.net

Can you post the other session related settings a well?



[2010-01-12 21:32:36] elmex at voll dot in

Description:

The Garbage Collection ist set to session.gc_maxlifetime=1440, but
there are a lot of session files set are older. In all hosts on the
server there is a virtual host setting for session.save_path like
session.save_path=/usr/local/www/hostname/phptmp. That is the only
session related setting, that was modified. A find for the files shows
currently:

find /usr/local/www/ -maxdepth 3 -mindepth 3 -name 'sess_*' -cmin +24 |
wc -l
8443

(amin is the same:)

find /usr/local/www/ -maxdepth 3 -mindepth 3 -name 'sess_*' -amin +24 |
wc -l
8443



Reproduce code:
---
no code, just settings

Expected result:

session files should be deleted after session.gc_maxlifetime or earlier

Actual result:
--
session files are not deleted or deleted too late





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



#50741 [NEW]: Midsized array of objects with arrays cause crash

2010-01-13 Thread thorsten dot engel at matrix-computer dot com
From: thorsten dot engel at matrix-computer dot com
Operating system: Win32+Gentoo Linux
PHP version:  5.3.2RC1
PHP Bug Type: Reproducible crash
Bug description:  Midsized array of objects with arrays cause crash

Description:

Hi,

we love php and tried to migrate from 5.2.11 to 5.3.1 and found a crash
when using midsize array of objects (nesting level=2). This problem does
not exist on 5.2.4, 5.2.6, 5.2.11, but exists ins 5.3.0, 5.3.1 and
5.3.2RC1. We could reproduce it as well on win32 and on linux.

It crashed in our case at around 10.000 on win32 and around 7600 on
linux.

It would be great if you guys can reproduce this as well!

Warm regards,

Thorsten



Reproduce code:
---
class test
{
protected $_a = array();
protected $_b = array();
protected $_i = array();

public function __construct($a,$b)
{
$this-_a = (array) $a;
$this-_b = (array) $b;
$this-_i = array();

if (count($a) == 0)
{
for ($i=0;$i10;$i++)
$this-_i[$i] = new test(array('1','2'), 
array());
}
}
}

$s = array();

for ($i=0;$i15000;$i++)
{
print $i.'br';
$x = new test(array(),array());
$s[] = $x;
}

Expected result:

completing with 15.000 lines.

Actual result:
--
crashing after 7.000 until 10.000 lines.

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



#50741 [Opn-Fbk]: Midsized array of objects with arrays cause crash

2010-01-13 Thread rasmus
 ID:   50741
 Updated by:   ras...@php.net
 Reported By:  thorsten dot engel at matrix-computer dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Reproducible crash
 Operating System: Win32+Gentoo Linux
 PHP Version:  5.3.2RC1
 New Comment:

Unable to reproduce here.  What do you mean by crash?  Memory is 
tracked more accurately in PHP 5.3 so if you are hitting your 
configured memory limit, that's not a bug.  Run it without a memory 
limit.


Previous Comments:


[2010-01-13 17:36:30] thorsten dot engel at matrix-computer dot com

Description:

Hi,

we love php and tried to migrate from 5.2.11 to 5.3.1 and found a
crash when using midsize array of objects (nesting level=2). This
problem does not exist on 5.2.4, 5.2.6, 5.2.11, but exists ins 5.3.0,
5.3.1 and 5.3.2RC1. We could reproduce it as well on win32 and on
linux.

It crashed in our case at around 10.000 on win32 and around 7600 on
linux.

It would be great if you guys can reproduce this as well!

Warm regards,

Thorsten



Reproduce code:
---
class test
{
protected $_a = array();
protected $_b = array();
protected $_i = array();

public function __construct($a,$b)
{
$this-_a = (array) $a;
$this-_b = (array) $b;
$this-_i = array();

if (count($a) == 0)
{
for ($i=0;$i10;$i++)
$this-_i[$i] = new test(array('1','2'), 
array());
}
}
}

$s = array();

for ($i=0;$i15000;$i++)
{
print $i.'br';
$x = new test(array(),array());
$s[] = $x;
}

Expected result:

completing with 15.000 lines.

Actual result:
--
crashing after 7.000 until 10.000 lines.





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



#50743 [NEW]: No escape function escapes properly

2010-01-13 Thread eric at sharecorp dot com
From: eric at sharecorp dot com
Operating system: Linux
PHP version:  5.2.12
PHP Bug Type: Strings related
Bug description:  No escape function escapes “” properly

Description:

None of the escaping functions are able to properly handle “” style
quotes, which are produced by default by open office.  Functions that I
have tested include mysql_real_escape_string, htmlentities, addslashes and
addcslashes.  This behavior causes text insertion into mysql to fail as it
interprets these quotes as normal double quotes.


 

Reproduce code:
---
$title = $_POST['title'];
$date = $_POST['date'];
$tagline = $_POST['tagline'];
$article =nl2br(htmlentities($_POST['article'],ENT_QUOTES));
//snip of some file handling
 $query = INSERT INTO news (title, date, tagline, article, image,
image_orig) VALUES ('$title', '$date', '$tagline', '$article',
'$image',$image_orig')



Expected result:

The “” should be caught, escaped properly and not affecting the query. In
this case $article was the varible containing the quotes in question.

Actual result:
--
All text after the opening quote is dropped from the data inserted into
the query.

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



#50743 [Opn-Fbk]: No escape function escapes properly

2010-01-13 Thread rasmus
 ID:   50743
 Updated by:   ras...@php.net
 Reported By:  eric at sharecorp dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Strings related
 Operating System: Linux
 PHP Version:  5.2.12
 New Comment:

Are you sure?

mysql select * from users where name=“rlerdorf”;
ERROR 1064 (42000): You have an error in your SQL syntax; check the 
manual that corresponds to your MySQL server version for the right 
syntax to use near '#65533;#65533;rlerdorf#65533;#65533;' at line
1
mysql select * from users where name=“rlerdorf”;
Empty set (0.03 sec)

As far as I can tell, MySQL does not treat those odd quotes as regular

quotes anywhere.

Please provide a standalone test case along with your MySQL version 
that shows this.


Previous Comments:


[2010-01-13 18:19:59] eric at sharecorp dot com

Description:

None of the escaping functions are able to properly handle “” style
quotes, which are produced by default by open office.  Functions that I
have tested include mysql_real_escape_string, htmlentities, addslashes
and addcslashes.  This behavior causes text insertion into mysql to fail
as it interprets these quotes as normal double quotes.


 

Reproduce code:
---
$title = $_POST['title'];
$date = $_POST['date'];
$tagline = $_POST['tagline'];
$article =nl2br(htmlentities($_POST['article'],ENT_QUOTES));
//snip of some file handling
 $query = INSERT INTO news (title, date, tagline, article, image,
image_orig) VALUES ('$title', '$date', '$tagline', '$article',
'$image',$image_orig')



Expected result:

The “” should be caught, escaped properly and not affecting the query.
In this case $article was the varible containing the quotes in question.

Actual result:
--
All text after the opening quote is dropped from the data inserted into
the query.





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



#50743 [Fbk-Opn]: No escape function escapes properly

2010-01-13 Thread eric at sharecorp dot com
 ID:   50743
 User updated by:  eric at sharecorp dot com
 Reported By:  eric at sharecorp dot com
-Status:   Feedback
+Status:   Open
 Bug Type: Strings related
 Operating System: Linux
 PHP Version:  5.2.12
 New Comment:

Mysql version 5.0.84-r1 from gentoo portage.
Stand alone example follows:
form.php
_

html
form action=handler.php method=post
Input: textarea name=article rows=5 cols=75/textarea
input type=submit name=submit value=Add News
/form
/html

__
handler.php
___
?
$host=127.0.0.1;
$user=user;
$dbpassword=password;
$db=db;
$connection = mysql_connect($host,$user,$dbpassword) or die(Couldn't
connect);
$db=mysql_select_db($db);
$article = nl2br(htmlentities($_POST['article'],ENT_QUOTES));
$query = INSERT INTO news2 (title, date, tagline, article, image,
image_orig) VALUES ('testing', '01-13-2010', 'testing', '$article', '0',
'0');
mysql_query($query) or die(couldn't execute query.mysql_error());
?

SQL for creating news2
_
REATE TABLE IF NOT EXISTS `news2` (
  `id` int(11) NOT NULL auto_increment,
  `title` varchar(40) collate utf8_unicode_ci NOT NULL,
  `date` date NOT NULL,
  `tagline` varchar(120) collate utf8_unicode_ci NOT NULL,
  `article` text collate utf8_unicode_ci NOT NULL,
  `image` int(11) NOT NULL,
  `image_orig` int(11) NOT NULL,
  PRIMARY KEY  (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
AUTO_INCREMENT=44 ;
_
Demo text
__
We are pleased to announce our improved website.  We've updated it to
have a cleaner, more modern look, improved existing features and added
some new features as well.

Let's take a quick tour of the “Products” section.  The first thing
you'll notice when you click on the “Products” link is that the product
categories have been updated.  This is now consistent with our 2010
Color Catalog.  The second thing that you'll notice is that the products
may not be listed alphabetically in their respective categories.  The
products are now ranked by the most clicked on to least clicked on.  In
other words, our most popular products are listed at the top of each
category.  A third thing you may notice is that there's an “Equipment”
section.  All of the products listed in the Color Catalog's Equipment
section can now be found here along with a picture.  
___
The insertion of the above text falters after Let's take a quick tour
of the and nothing else posts.


Previous Comments:


[2010-01-13 18:25:35] ras...@php.net

Are you sure?

mysql select * from users where name=“rlerdorf”;
ERROR 1064 (42000): You have an error in your SQL syntax; check the 
manual that corresponds to your MySQL server version for the right 
syntax to use near '#65533;#65533;rlerdorf#65533;#65533;' at line
1
mysql select * from users where name=“rlerdorf”;
Empty set (0.03 sec)

As far as I can tell, MySQL does not treat those odd quotes as regular

quotes anywhere.

Please provide a standalone test case along with your MySQL version 
that shows this.



[2010-01-13 18:19:59] eric at sharecorp dot com

Description:

None of the escaping functions are able to properly handle “” style
quotes, which are produced by default by open office.  Functions that I
have tested include mysql_real_escape_string, htmlentities, addslashes
and addcslashes.  This behavior causes text insertion into mysql to fail
as it interprets these quotes as normal double quotes.


 

Reproduce code:
---
$title = $_POST['title'];
$date = $_POST['date'];
$tagline = $_POST['tagline'];
$article =nl2br(htmlentities($_POST['article'],ENT_QUOTES));
//snip of some file handling
 $query = INSERT INTO news (title, date, tagline, article, image,
image_orig) VALUES ('$title', '$date', '$tagline', '$article',
'$image',$image_orig')



Expected result:

The “” should be caught, escaped properly and not affecting the query.
In this case $article was the varible containing the quotes in question.

Actual result:
--
All text after the opening quote is dropped from the data inserted into
the query.





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



#50698 [Opn]: SoapClient should handle wsdls with some incompatiable endpoints

2010-01-13 Thread srinatar
 ID:   50698
 Updated by:   srina...@php.net
 Reported By:  zippy1981 at gmail dot com
 Status:   Open
 Bug Type: Feature/Change Request
 Operating System: Windows XP/7 and probably all.
 PHP Version:  5.2.12, 5.3.1
 New Comment:

thanks for the clarification. if you can provide a test case /script ,
it would help us to work on this. thanks again for taking time for
following up on this. your help will definitely help PHP make better !


Previous Comments:


[2010-01-13 15:05:54] zippy1981 at gmail dot com

It seems I was not clear in my original ticket.

My soap service has two end points. One is http (soap 1.1). The other 
is nettcp, microsoft private protocol.

PHP throws an error when I parse the WSDL simply because it contains 
an endpoint it can't connect to. This is in spite of the following 
four facts:

1) There is a http endpoint it knows how to connect to in the WSDL
2) I override the WSDL endpoints in the soap constructor.
3) A soap client only needs to connect to one endpoint in a WSDL to 
communicate with it

If I manually edit the WSDL so that the nettcp endpoint is no longer 
advertised, but it still exists, PHP will connect to it fine.



[2010-01-13 14:41:18] srina...@php.net

as far as I understand, Microsoft TCP transport spec is a private 
interface for communicating between .Net server/clients. I would expect

that you will need SOAP/TCP as end point for communicating between php

client and .Net server. 

Af course,my knowledge might be outdated on this. 



[2010-01-12 21:49:27] zippy1981 at gmail dot com

Verified on Windows 7 as well.



[2010-01-10 22:10:39] zippy1981 at gmail dot com

Also verified to break on 5.3.1.



[2010-01-08 21:52:35] zippy1981 at gmail dot com

I also reported this on stack overflow. If anyone has any suggestions 
for workarounds, especially if there workaround on the .NET side feel 
free to post them there.


http://stackoverflow.com/questions/1933213/connecting-to-a-wcf-service-
in-php-that-has-a-a-nettcp-binding-and-a-basichttpbin



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

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



#50698 [Opn]: SoapClient should handle wsdls with some incompatiable endpoints

2010-01-13 Thread zippy1981 at gmail dot com
 ID:   50698
 User updated by:  zippy1981 at gmail dot com
 Reported By:  zippy1981 at gmail dot com
 Status:   Open
 Bug Type: Feature/Change Request
 Operating System: Windows XP/7 and probably all.
 PHP Version:  5.2.12, 5.3.1
 New Comment:

Thanks for your reply.

On my initial report I posted an example client. In a comment in the 
example client is a link to a github repo with a .NET web service that

causes this issue (e.g. config file was bound to nettcp):

http://github.com/zippy1981/EchoService

Inside the .net service is also a copy of the PHP client.

The .NET code can be compiled on any windows machine with the free IDE

SharpDevelop (http://www.icsharpcode.net/OpenSource/SD/Download/)

I can provide a manually generated wsdl  with false endpoints if
needed. 
I'll gladly help test a fix or provide a mock if needed.


Previous Comments:


[2010-01-13 20:29:39] srina...@php.net

thanks for the clarification. if you can provide a test case /script ,
it would help us to work on this. thanks again for taking time for
following up on this. your help will definitely help PHP make better !



[2010-01-13 15:05:54] zippy1981 at gmail dot com

It seems I was not clear in my original ticket.

My soap service has two end points. One is http (soap 1.1). The other 
is nettcp, microsoft private protocol.

PHP throws an error when I parse the WSDL simply because it contains 
an endpoint it can't connect to. This is in spite of the following 
four facts:

1) There is a http endpoint it knows how to connect to in the WSDL
2) I override the WSDL endpoints in the soap constructor.
3) A soap client only needs to connect to one endpoint in a WSDL to 
communicate with it

If I manually edit the WSDL so that the nettcp endpoint is no longer 
advertised, but it still exists, PHP will connect to it fine.



[2010-01-13 14:41:18] srina...@php.net

as far as I understand, Microsoft TCP transport spec is a private 
interface for communicating between .Net server/clients. I would expect

that you will need SOAP/TCP as end point for communicating between php

client and .Net server. 

Af course,my knowledge might be outdated on this. 



[2010-01-12 21:49:27] zippy1981 at gmail dot com

Verified on Windows 7 as well.



[2010-01-10 22:10:39] zippy1981 at gmail dot com

Also verified to break on 5.3.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/50698

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



#49815 [Asn-Fbk]: Problem with imagettfbbox

2010-01-13 Thread tabe
 ID:   49815
 Updated by:   t...@php.net
 Reported By:  christian dot roy at orange dot fr
-Status:   Assigned
+Status:   Feedback
 Bug Type: GD related
 Operating System: Linux
 PHP Version:  5.2.11
 Assigned To:  tabe
 New Comment:

rasmus, your observation is essential to understand this bug.
fix for bug#45600 also seems to work well.

With PHP_5_2 or trunk:

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

bbox returned rectangle for k : -1  *  -1  *  42  *  -1  *  42  *  -62 
*  -1  *  -62

bbox returned rectangle for j : -1  *  17  *  23  *  17  *  23  *  -57 
*  -1  *  -57


Previous Comments:


[2009-12-23 17:49:24] christian dot roy at orange dot fr

Hi,

Did you progress on this issue whicj sticks me to PHP 4.

Thanks for your answer.



[2009-12-16 21:56:23] rasmus at mindplay dot dk

To help you debug this issue, I created the following test-script:

?php

define('SAMPLE', @$_SERVER['QUERY_STRING'] ? $_SERVER['QUERY_STRING'] :
'abc');
define('SAMPLE_TTF', dirname(__FILE__).'/georgiai.ttf');
define('SAMPLE_SIZE', 100);
define('SAMPLE_PAD', 50);

$m = imagettfbbox(SAMPLE_SIZE, 0, SAMPLE_TTF, SAMPLE);

$width = $m[4]-$m[6] + 2*SAMPLE_PAD;
$height = $m[1]-$m[7] + 2*SAMPLE_PAD;

$baseline = abs($m[7]);

$img = imagecreatetruecolor($width,$height);
$red = imagecolorallocate($img,255,0,0);
$white = imagecolorallocate($img,255,255,255);

imagettftext(
  $img,
  SAMPLE_SIZE, # size
  0,   # angle
  SAMPLE_PAD,  # x
  SAMPLE_PAD+$baseline,  # y
  $white,
  SAMPLE_TTF,
  SAMPLE
);

imagerectangle(
  $img,
  $m[6]+SAMPLE_PAD, $m[7]+SAMPLE_PAD+$baseline, # upper left x,y
  $m[2]+SAMPLE_PAD, $m[3]+SAMPLE_PAD+$baseline, # lower right x,y
  $red
);

header('Content-type: image/png');
imagepng($img);

?

You will need to adjust the SAMPLE_TTF path to point to a valid
truetype file - the one I'm using is Windows standard Georgia Italics.

The output should be a white sample of text with a red border, and the
border should grace the text, not overlap it.

For reference, here's what it looks like on Linux (GOOD):

http://mindplay.dk/temp/metrics/imagettf-good.png

And here's what it looks like on Windows (BAD):

http://mindplay.dk/temp/metrics/imagettf-bad.png

I just tried the latest XAMPP build (1.7.2 beta 2) for Windows, and the
bug is still present.

If you run the script from a browser, you can add your own sample text
by adding a query string, e.g.:

http://localhost/sample.php?abcdefg

Note that using a larger font-size (SAMPLE_SIZE) seems to increase the
error. It seems that all the returned coordinates are off by a
percentage, not by a fixed number of pixels.

I hope this helps solve the problem...



[2009-12-08 13:57:04] rasmus at mindplay dot dk

This problem occurs with imageftbbox() as well.

I developed a font-embedding system (http://fontjazz.com) and it has 
worked for a long time with PHP5.1 and earlier, but never with PHP 5.2

or 5.3, where the coordinates (both X and Y) come out all wrong.

I'm using Windows for development, Linux for deployment, and I have to

keep the production server running with PHP 5.1 for this reason - both

Linux and Windows versions fail to give the right coordinates.



[2009-10-08 20:19:09] paj...@php.net

Tabe, can you look at this one too please? :)



[2009-10-08 20:14:30] christian dot roy at orange dot fr

Sorry. 

Actual result should have been :

with 5.2.11 :

bbox returned rectangle for a : -1  *  1  *  32  *  1  *  32  *  -38  *
 -1  *  -38

bbox returned rectangle for k : -1  *  -1  *  37  *  -1  *  37  *  -57 
*  -1  *  -57

bbox returned rectangle for j : -1  *  17  *  21  *  17  *  21  *  -57 
*  -1  *  -57



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

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



#49815 [Fbk]: Problem with imagettfbbox

2010-01-13 Thread tabe
 ID:   49815
 Updated by:   t...@php.net
 Reported By:  christian dot roy at orange dot fr
 Status:   Feedback
 Bug Type: GD related
 Operating System: Linux
 PHP Version:  5.2.11
 Assigned To:  tabe
 New Comment:

s/#45600/#49600/


Previous Comments:


[2010-01-14 04:59:07] t...@php.net

rasmus, your observation is essential to understand this bug.
fix for bug#45600 also seems to work well.

With PHP_5_2 or trunk:

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

bbox returned rectangle for k : -1  *  -1  *  42  *  -1  *  42  *  -62 
*  -1  *  -62

bbox returned rectangle for j : -1  *  17  *  23  *  17  *  23  *  -57 
*  -1  *  -57



[2009-12-23 17:49:24] christian dot roy at orange dot fr

Hi,

Did you progress on this issue whicj sticks me to PHP 4.

Thanks for your answer.



[2009-12-16 21:56:23] rasmus at mindplay dot dk

To help you debug this issue, I created the following test-script:

?php

define('SAMPLE', @$_SERVER['QUERY_STRING'] ? $_SERVER['QUERY_STRING'] :
'abc');
define('SAMPLE_TTF', dirname(__FILE__).'/georgiai.ttf');
define('SAMPLE_SIZE', 100);
define('SAMPLE_PAD', 50);

$m = imagettfbbox(SAMPLE_SIZE, 0, SAMPLE_TTF, SAMPLE);

$width = $m[4]-$m[6] + 2*SAMPLE_PAD;
$height = $m[1]-$m[7] + 2*SAMPLE_PAD;

$baseline = abs($m[7]);

$img = imagecreatetruecolor($width,$height);
$red = imagecolorallocate($img,255,0,0);
$white = imagecolorallocate($img,255,255,255);

imagettftext(
  $img,
  SAMPLE_SIZE, # size
  0,   # angle
  SAMPLE_PAD,  # x
  SAMPLE_PAD+$baseline,  # y
  $white,
  SAMPLE_TTF,
  SAMPLE
);

imagerectangle(
  $img,
  $m[6]+SAMPLE_PAD, $m[7]+SAMPLE_PAD+$baseline, # upper left x,y
  $m[2]+SAMPLE_PAD, $m[3]+SAMPLE_PAD+$baseline, # lower right x,y
  $red
);

header('Content-type: image/png');
imagepng($img);

?

You will need to adjust the SAMPLE_TTF path to point to a valid
truetype file - the one I'm using is Windows standard Georgia Italics.

The output should be a white sample of text with a red border, and the
border should grace the text, not overlap it.

For reference, here's what it looks like on Linux (GOOD):

http://mindplay.dk/temp/metrics/imagettf-good.png

And here's what it looks like on Windows (BAD):

http://mindplay.dk/temp/metrics/imagettf-bad.png

I just tried the latest XAMPP build (1.7.2 beta 2) for Windows, and the
bug is still present.

If you run the script from a browser, you can add your own sample text
by adding a query string, e.g.:

http://localhost/sample.php?abcdefg

Note that using a larger font-size (SAMPLE_SIZE) seems to increase the
error. It seems that all the returned coordinates are off by a
percentage, not by a fixed number of pixels.

I hope this helps solve the problem...



[2009-12-08 13:57:04] rasmus at mindplay dot dk

This problem occurs with imageftbbox() as well.

I developed a font-embedding system (http://fontjazz.com) and it has 
worked for a long time with PHP5.1 and earlier, but never with PHP 5.2

or 5.3, where the coordinates (both X and Y) come out all wrong.

I'm using Windows for development, Linux for deployment, and I have to

keep the production server running with PHP 5.1 for this reason - both

Linux and Windows versions fail to give the right coordinates.



[2009-10-08 20:19:09] paj...@php.net

Tabe, can you look at this one too please? :)



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

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