#45540 [Fbk->Opn]: stream_context_create creates bad http request

2008-07-27 Thread jdespatis at yahoo dot fr
 ID:   45540
 User updated by:  jdespatis at yahoo dot fr
 Reported By:  jdespatis at yahoo dot fr
-Status:   Feedback
+Status:   Open
 Bug Type: Streams related
 Operating System: Linux Kubuntu
 PHP Version:  5.2.6
 Assigned To:  fb-req-jani
 New Comment:

Well, i can give you a self-contained reproducing script:
http://www.despatis.com/php/stream.phps

But, it's impossible for me to avoid the use of POST, because this bug
occurs on a http connection..

To run the bug, you just do in the command line (so using php cli):
$ php stream.php

I get the following result, you'll need a sniffer to see that data sent
to http server is completely weird

token :
AIwbFASbZooZXBAePnl4eayE1cZvRWbvOtzQTC-vRR-lkp1r3ijZ7AxoSIzuslTVmufPznylay34ryUPdLRMGh61cidHS29Z7NkKqLVYr2JdNY4iKN0qoVB2MSaV2rmumH_ZJTo3gp7Or0IJlaiMiNEs2R5aNllOYg
Array
(
[type] => 2
[message] =>
file_get_contents(http://uploads.gdata.youtube.com/feeds/api/users/bigbluezen/uploads):
failed to open stream: HTTP request failed! HTTP/1.0 411 Length
Required

[file] =>
/home/enzo/projects/lacartoonerie/download/modules/stream.php
[line] => 101
)


Previous Comments:


[2008-07-20 11:10:00] [EMAIL PROTECTED]

Ok. Now can you provide a proper self-contained reproducing script. One
that starts with  and can be run on the command line.
ie. no POST required..



[2008-07-18 16:45:03] jdespatis at yahoo dot fr

[EMAIL PROTECTED]:~$ cat php-5.2.6/config.nice

#! /bin/sh
#
# Created by configure

'./configure' \
'--enable-sockets' \
'--enable-soap' \
'--with-mysql' \
'--enable-mbstring' \
'--enable-ftp' \
'--with-zlib' \
'--with-openssl' \
'--prefix=/home/enzo/divers/php_compil/' \
'--exec-prefix=/home/enzo/divers/php_compil/' \
'--disable-short-tags' \
"$@"



[2008-07-18 16:05:44] [EMAIL PROTECTED]

For the second time: What was the configure line you used to build PHP?



[2008-07-18 12:23:17] jdespatis at yahoo dot fr

And to help to diagnose the problem

i can perfectly make this script work if I code the stream by my own
for example, I replace stream_context_create by some code using
fsockopen, all works perfectly ... (i really think stream_context_create
leaves some \r \n in some special case ...)

$context = stream_context_create($opts);
$buff =
@file_get_contents("http://uploads.gdata.youtube.com/feeds/api/users/$username/uploads";,
false, $context);

by

$fp = fsockopen("uploads.gdata.youtube.com", 80, $errno, $errstr, 30);
if (!$fp) {
  return "Youtube unreachable $errstr ($errno)";
}
$out  = "POST /feeds/api/users/$username/uploads HTTP/1.0\r\n";
$out .= "Host: uploads.gdata.youtube.com\r\n";
$out .= "Content-Length: " . strlen($opts["http"]["content"] ."\r\n";
$out .= "Connection: Close\r\n";
$out .= $opts["http"]["header"];
$out .= "\r\n";
$out .= $opts["http"]["content"];
fwrite($fp, $out);
$buff = "";
while (!feof($fp)) {
  $buff .= fgets($fp, 4096);
}
fclose($fp);



[2008-07-18 08:44:26] jdespatis at yahoo dot fr

No this bug is different than bug 43222.
In the latter the post content seems to be good except a CRLF more
which is not dramatic

In my case, the post content and header are completely broken...

I've modified my configuration to forbid short open tag
(i check with echo ini_get("short_open_tag") which returns nothing
meaning false)

and i get the same bug.

But as I said, one could thing the bug comes from here (i've thought
also), but not at all, the bug disappear if i let the short tag http://bugs.php.net/45540

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



#45540 [Fbk->Opn]: stream_context_create creates bad http request

2008-07-18 Thread jdespatis at yahoo dot fr
 ID:   45540
 User updated by:  jdespatis at yahoo dot fr
 Reported By:  jdespatis at yahoo dot fr
-Status:   Feedback
+Status:   Open
 Bug Type: Streams related
 Operating System: Linux Kubuntu
 PHP Version:  5.2.6
 New Comment:

[EMAIL PROTECTED]:~$ cat php-5.2.6/config.nice

#! /bin/sh
#
# Created by configure

'./configure' \
'--enable-sockets' \
'--enable-soap' \
'--with-mysql' \
'--enable-mbstring' \
'--enable-ftp' \
'--with-zlib' \
'--with-openssl' \
'--prefix=/home/enzo/divers/php_compil/' \
'--exec-prefix=/home/enzo/divers/php_compil/' \
'--disable-short-tags' \
"$@"


Previous Comments:


[2008-07-18 16:05:44] [EMAIL PROTECTED]

For the second time: What was the configure line you used to build PHP?

----

[2008-07-18 12:23:17] jdespatis at yahoo dot fr

And to help to diagnose the problem

i can perfectly make this script work if I code the stream by my own
for example, I replace stream_context_create by some code using
fsockopen, all works perfectly ... (i really think stream_context_create
leaves some \r \n in some special case ...)

$context = stream_context_create($opts);
$buff =
@file_get_contents("http://uploads.gdata.youtube.com/feeds/api/users/$username/uploads";,
false, $context);

by

$fp = fsockopen("uploads.gdata.youtube.com", 80, $errno, $errstr, 30);
if (!$fp) {
  return "Youtube unreachable $errstr ($errno)";
}
$out  = "POST /feeds/api/users/$username/uploads HTTP/1.0\r\n";
$out .= "Host: uploads.gdata.youtube.com\r\n";
$out .= "Content-Length: " . strlen($opts["http"]["content"] ."\r\n";
$out .= "Connection: Close\r\n";
$out .= $opts["http"]["header"];
$out .= "\r\n";
$out .= $opts["http"]["content"];
fwrite($fp, $out);
$buff = "";
while (!feof($fp)) {
  $buff .= fgets($fp, 4096);
}
fclose($fp);



[2008-07-18 08:44:26] jdespatis at yahoo dot fr

No this bug is different than bug 43222.
In the latter the post content seems to be good except a CRLF more
which is not dramatic

In my case, the post content and header are completely broken...

I've modified my configuration to forbid short open tag
(i check with echo ini_get("short_open_tag") which returns nothing
meaning false)

and i get the same bug.

But as I said, one could thing the bug comes from here (i've thought
also), but not at all, the bug disappear if i let the short tag  "bigbluezen", "password" => "demo",
"title" => "ultimate video topmoumoute", "tags" => "test machin bidule",
"channel" => "poetic");

  print_r(publish("nothing.mp4", $params));
?>



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

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



#45540 [Opn]: stream_context_create creates bad http request

2008-07-18 Thread jdespatis at yahoo dot fr
 ID:   45540
 User updated by:  jdespatis at yahoo dot fr
 Reported By:  jdespatis at yahoo dot fr
 Status:   Open
 Bug Type: Streams related
 Operating System: Linux Kubuntu
 PHP Version:  5.2.6
 New Comment:

And to help to diagnose the problem

i can perfectly make this script work if I code the stream by my own
for example, I replace stream_context_create by some code using
fsockopen, all works perfectly ... (i really think stream_context_create
leaves some \r \n in some special case ...)

$context = stream_context_create($opts);
$buff =
@file_get_contents("http://uploads.gdata.youtube.com/feeds/api/users/$username/uploads";,
false, $context);

by

$fp = fsockopen("uploads.gdata.youtube.com", 80, $errno, $errstr, 30);
if (!$fp) {
  return "Youtube unreachable $errstr ($errno)";
}
$out  = "POST /feeds/api/users/$username/uploads HTTP/1.0\r\n";
$out .= "Host: uploads.gdata.youtube.com\r\n";
$out .= "Content-Length: " . strlen($opts["http"]["content"] ."\r\n";
$out .= "Connection: Close\r\n";
$out .= $opts["http"]["header"];
$out .= "\r\n";
$out .= $opts["http"]["content"];
fwrite($fp, $out);
$buff = "";
while (!feof($fp)) {
  $buff .= fgets($fp, 4096);
}
fclose($fp);


Previous Comments:


[2008-07-18 08:44:26] jdespatis at yahoo dot fr

No this bug is different than bug 43222.
In the latter the post content seems to be good except a CRLF more
which is not dramatic

In my case, the post content and header are completely broken...

I've modified my configuration to forbid short open tag
(i check with echo ini_get("short_open_tag") which returns nothing
meaning false)

and i get the same bug.

But as I said, one could thing the bug comes from here (i've thought
also), but not at all, the bug disappear if i let the short tag  "bigbluezen", "password" => "demo",
"title" => "ultimate video topmoumoute", "tags" => "test machin bidule",
"channel" => "poetic");

  print_r(publish("nothing.mp4", $params));
?>



[2008-07-17 07:10:23] jdespatis at yahoo dot fr

Description:

I'm coding a little script to upload a video on Youtube, thanks to
stream functions in php.

It takes 2 steps:
1/ first connect on google to retrieve token, no problem with php code
2/ upload video with a query in POST, and there stream_context_create
is giving a completely broken query.. From time to time, i can make it
work, but it's pure random

I have used a sniffer as wireshark to see the exact http query

Reproduce code:
---
Here is the piece of code that does all this stuff:
http://www.despatis.com/php/bug.phps

Expected result:

PHP CLIENT => YOUTUBE SERVER:
POST /feeds/api/users/bigbluezen/uploads HTTP/1.0
Host: uploads.gdata.youtube.com
Content-Length: 792
Content-Type: multipart/related;
boundary="---cefe168b3cb99683a0f9ebd6f9b2cca6"
Authorization: GoogleLogin
auth=AIwbFAQtr5MDW_ctllHioiYCpY6I_uF6A9zBcSbIQ8AceGbcYfqrmytEICM8p6VjjzygDd2HPL0YhTcVk2MPmtb9y93-9Fs3yiej8hBtLF60_N_a6aWDg9Mrbm18nP-2dTVvTA6h77eJZrOJICzgN3dZyPT4AN1ffQ
X-GData-Client: ytapi-SourceRH-LaCartoonerie-3lludu8g-0
X-GData-Key:
key=AI39si44WZavBNwYryVhVFaMH4Y8e0JbTAr83bScAxKby6LBW3xEyBzaXrV7MTw3sm56SmYVhSOWRXNfUrS0sqC1i7313ycFrQ
Slug: c447e7c1c0b79e8dc97c76cdc16e9843.gif

-cefe168b3cb99683a0f9ebd6f9b2cca6
Content-Type: application/atom+xml; charset=UTF-8


http://www.w3.org/2005/Atom";
xmlns:media="http://search.yahoo.com/mrss/";
xmlns:yt="http://gdata.youtube.com/schemas/2007";>
  
title foo
description
foo
http://gdata.youtube.com/schemas/2007/categories.cat";>People
key1, key2
  


-cefe168b3cb99683a0f9ebd6f9b2cca6
Content-Type: video/gif
Content-Transfer-Encoding: binary

XXX
-cefe168b3cb99683a0f9ebd6f9b2cca6--

Actual result:
--
The actual result, found with a sniffer (wireshark for example) is:

PHP CLIENT => YOUTUBE SERVER:
POST
/feeds/api/users/bigbluezen/uploads/wFqcFtuB9MY?client=ytapi-SourceRH-LaCartoonerie-3lludu8g-0
HTTP/1.0
Host: gdata.youtube.com
Authorization: GoogleLogin
auth=AIwbFASurkAdrgigXGJeP24Ebc0dM7EierouUTZ7Nqm2pjSzo2aRtNXQgOo-_ebco_-w7CmpxcZqysZKS_UGCUSc-K6tD5NI84jIc7sf1Sq8cPtcbknOrvlqxF6PNBj-kLzeXEPnBwKoE4vJDuwE0ag7Aleyo-u3hw
X-GData-Client: ytapi-SourceRH-LaCartoonerie-3lludu8g-0
X-GData-Key:
key=AI39si44WZavBNwYryVhVFaMH4Y8e0JbTAr83bScAxKby6LBW3xEyBzaXrV7MTw3sm56SmYVhSOWRXNfUrS0sqC1i7313ycFrQ
Slug:
c447e7c1c0b79e8dc97c76cdc16e9843.gifbScA

#45540 [Fbk->Opn]: stream_context_create creates bad http request

2008-07-18 Thread jdespatis at yahoo dot fr
 ID:   45540
 User updated by:  jdespatis at yahoo dot fr
 Reported By:  jdespatis at yahoo dot fr
-Status:   Feedback
+Status:   Open
 Bug Type: Streams related
 Operating System: Linux Kubuntu
 PHP Version:  5.2.6
 New Comment:

No this bug is different than bug 43222.
In the latter the post content seems to be good except a CRLF more
which is not dramatic

In my case, the post content and header are completely broken...

I've modified my configuration to forbid short open tag
(i check with echo ini_get("short_open_tag") which returns nothing
meaning false)

and i get the same bug.

But as I said, one could thing the bug comes from here (i've thought
also), but not at all, the bug disappear if i let the short tag  "bigbluezen", "password" => "demo",
"title" => "ultimate video topmoumoute", "tags" => "test machin bidule",
"channel" => "poetic");

  print_r(publish("nothing.mp4", $params));
?>



[2008-07-17 07:10:23] jdespatis at yahoo dot fr

Description:

I'm coding a little script to upload a video on Youtube, thanks to
stream functions in php.

It takes 2 steps:
1/ first connect on google to retrieve token, no problem with php code
2/ upload video with a query in POST, and there stream_context_create
is giving a completely broken query.. From time to time, i can make it
work, but it's pure random

I have used a sniffer as wireshark to see the exact http query

Reproduce code:
---
Here is the piece of code that does all this stuff:
http://www.despatis.com/php/bug.phps

Expected result:

PHP CLIENT => YOUTUBE SERVER:
POST /feeds/api/users/bigbluezen/uploads HTTP/1.0
Host: uploads.gdata.youtube.com
Content-Length: 792
Content-Type: multipart/related;
boundary="---cefe168b3cb99683a0f9ebd6f9b2cca6"
Authorization: GoogleLogin
auth=AIwbFAQtr5MDW_ctllHioiYCpY6I_uF6A9zBcSbIQ8AceGbcYfqrmytEICM8p6VjjzygDd2HPL0YhTcVk2MPmtb9y93-9Fs3yiej8hBtLF60_N_a6aWDg9Mrbm18nP-2dTVvTA6h77eJZrOJICzgN3dZyPT4AN1ffQ
X-GData-Client: ytapi-SourceRH-LaCartoonerie-3lludu8g-0
X-GData-Key:
key=AI39si44WZavBNwYryVhVFaMH4Y8e0JbTAr83bScAxKby6LBW3xEyBzaXrV7MTw3sm56SmYVhSOWRXNfUrS0sqC1i7313ycFrQ
Slug: c447e7c1c0b79e8dc97c76cdc16e9843.gif

-cefe168b3cb99683a0f9ebd6f9b2cca6
Content-Type: application/atom+xml; charset=UTF-8


http://www.w3.org/2005/Atom";
xmlns:media="http://search.yahoo.com/mrss/";
xmlns:yt="http://gdata.youtube.com/schemas/2007";>
  
title foo
description
foo
http://gdata.youtube.com/schemas/2007/categories.cat";>People
key1, key2
  


-cefe168b3cb99683a0f9ebd6f9b2cca6
Content-Type: video/gif
Content-Transfer-Encoding: binary

XXX
-cefe168b3cb99683a0f9ebd6f9b2cca6--

Actual result:
--
The actual result, found with a sniffer (wireshark for example) is:

PHP CLIENT => YOUTUBE SERVER:
POST
/feeds/api/users/bigbluezen/uploads/wFqcFtuB9MY?client=ytapi-SourceRH-LaCartoonerie-3lludu8g-0
HTTP/1.0
Host: gdata.youtube.com
Authorization: GoogleLogin
auth=AIwbFASurkAdrgigXGJeP24Ebc0dM7EierouUTZ7Nqm2pjSzo2aRtNXQgOo-_ebco_-w7CmpxcZqysZKS_UGCUSc-K6tD5NI84jIc7sf1Sq8cPtcbknOrvlqxF6PNBj-kLzeXEPnBwKoE4vJDuwE0ag7Aleyo-u3hw
X-GData-Client: ytapi-SourceRH-LaCartoonerie-3lludu8g-0
X-GData-Key:
key=AI39si44WZavBNwYryVhVFaMH4Y8e0JbTAr83bScAxKby6LBW3xEyBzaXrV7MTw3sm56SmYVhSOWRXNfUrS0sqC1i7313ycFrQ
Slug:
c447e7c1c0b79e8dc97c76cdc16e9843.gifbScAxKby6LBW3xEyBzaXrV7MTw3sm56SmYVhSOWRXNfUrS0sqC1i7313ycFrQ
Slug: c447e7c1c0b79e8dc97c76cdc16e9843.gif

EOF

As you can see, the first query is completely messy !!

The funny thing is that: if i change '' to '' at line 64, the http query is good...

One could thing  in the xml and change another things (add
an echo somewhere, but this trick doesn't work all the time)

As the result is very random, i think file_get_contents doesn't get all
data from the string, leaving some \r\n, which mess the following http
query, maybe something like that...






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



#45540 [Opn]: stream_context_create creates bad http request

2008-07-17 Thread jdespatis at yahoo dot fr
 ID:   45540
 User updated by:  jdespatis at yahoo dot fr
 Reported By:  jdespatis at yahoo dot fr
 Status:   Open
 Bug Type: Streams related
 Operating System: Linux Kubuntu
 PHP Version:  5.2.6
 New Comment:

Oups, my script bug.php contains a function

To test it, one can use this simple script :
(no need to create a nothing.mp4 to use this example)

 "bigbluezen", "password" => "demo",
"title" => "ultimate video topmoumoute", "tags" => "test machin bidule",
"channel" => "poetic");

  print_r(publish("nothing.mp4", $params));
?>


Previous Comments:
--------

[2008-07-17 07:10:23] jdespatis at yahoo dot fr

Description:

I'm coding a little script to upload a video on Youtube, thanks to
stream functions in php.

It takes 2 steps:
1/ first connect on google to retrieve token, no problem with php code
2/ upload video with a query in POST, and there stream_context_create
is giving a completely broken query.. From time to time, i can make it
work, but it's pure random

I have used a sniffer as wireshark to see the exact http query

Reproduce code:
---
Here is the piece of code that does all this stuff:
http://www.despatis.com/php/bug.phps

Expected result:

PHP CLIENT => YOUTUBE SERVER:
POST /feeds/api/users/bigbluezen/uploads HTTP/1.0
Host: uploads.gdata.youtube.com
Content-Length: 792
Content-Type: multipart/related;
boundary="---cefe168b3cb99683a0f9ebd6f9b2cca6"
Authorization: GoogleLogin
auth=AIwbFAQtr5MDW_ctllHioiYCpY6I_uF6A9zBcSbIQ8AceGbcYfqrmytEICM8p6VjjzygDd2HPL0YhTcVk2MPmtb9y93-9Fs3yiej8hBtLF60_N_a6aWDg9Mrbm18nP-2dTVvTA6h77eJZrOJICzgN3dZyPT4AN1ffQ
X-GData-Client: ytapi-SourceRH-LaCartoonerie-3lludu8g-0
X-GData-Key:
key=AI39si44WZavBNwYryVhVFaMH4Y8e0JbTAr83bScAxKby6LBW3xEyBzaXrV7MTw3sm56SmYVhSOWRXNfUrS0sqC1i7313ycFrQ
Slug: c447e7c1c0b79e8dc97c76cdc16e9843.gif

-cefe168b3cb99683a0f9ebd6f9b2cca6
Content-Type: application/atom+xml; charset=UTF-8


http://www.w3.org/2005/Atom";
xmlns:media="http://search.yahoo.com/mrss/";
xmlns:yt="http://gdata.youtube.com/schemas/2007";>
  
title foo
description
foo
http://gdata.youtube.com/schemas/2007/categories.cat";>People
key1, key2
  


-cefe168b3cb99683a0f9ebd6f9b2cca6
Content-Type: video/gif
Content-Transfer-Encoding: binary

XXX
-cefe168b3cb99683a0f9ebd6f9b2cca6--

Actual result:
--
The actual result, found with a sniffer (wireshark for example) is:

PHP CLIENT => YOUTUBE SERVER:
POST
/feeds/api/users/bigbluezen/uploads/wFqcFtuB9MY?client=ytapi-SourceRH-LaCartoonerie-3lludu8g-0
HTTP/1.0
Host: gdata.youtube.com
Authorization: GoogleLogin
auth=AIwbFASurkAdrgigXGJeP24Ebc0dM7EierouUTZ7Nqm2pjSzo2aRtNXQgOo-_ebco_-w7CmpxcZqysZKS_UGCUSc-K6tD5NI84jIc7sf1Sq8cPtcbknOrvlqxF6PNBj-kLzeXEPnBwKoE4vJDuwE0ag7Aleyo-u3hw
X-GData-Client: ytapi-SourceRH-LaCartoonerie-3lludu8g-0
X-GData-Key:
key=AI39si44WZavBNwYryVhVFaMH4Y8e0JbTAr83bScAxKby6LBW3xEyBzaXrV7MTw3sm56SmYVhSOWRXNfUrS0sqC1i7313ycFrQ
Slug:
c447e7c1c0b79e8dc97c76cdc16e9843.gifbScAxKby6LBW3xEyBzaXrV7MTw3sm56SmYVhSOWRXNfUrS0sqC1i7313ycFrQ
Slug: c447e7c1c0b79e8dc97c76cdc16e9843.gif

EOF

As you can see, the first query is completely messy !!

The funny thing is that: if i change '' to '' at line 64, the http query is good...

One could thing  in the xml and change another things (add
an echo somewhere, but this trick doesn't work all the time)

As the result is very random, i think file_get_contents doesn't get all
data from the string, leaving some \r\n, which mess the following http
query, maybe something like that...






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



#45540 [NEW]: stream_context_create creates bad http request

2008-07-17 Thread jdespatis at yahoo dot fr
From: jdespatis at yahoo dot fr
Operating system: Linux Kubuntu
PHP version:  5.2.6
PHP Bug Type: Streams related
Bug description:  stream_context_create creates bad http request

Description:

I'm coding a little script to upload a video on Youtube, thanks to stream
functions in php.

It takes 2 steps:
1/ first connect on google to retrieve token, no problem with php code
2/ upload video with a query in POST, and there stream_context_create is
giving a completely broken query.. From time to time, i can make it work,
but it's pure random

I have used a sniffer as wireshark to see the exact http query

Reproduce code:
---
Here is the piece of code that does all this stuff:
http://www.despatis.com/php/bug.phps

Expected result:

PHP CLIENT => YOUTUBE SERVER:
POST /feeds/api/users/bigbluezen/uploads HTTP/1.0
Host: uploads.gdata.youtube.com
Content-Length: 792
Content-Type: multipart/related;
boundary="---cefe168b3cb99683a0f9ebd6f9b2cca6"
Authorization: GoogleLogin
auth=AIwbFAQtr5MDW_ctllHioiYCpY6I_uF6A9zBcSbIQ8AceGbcYfqrmytEICM8p6VjjzygDd2HPL0YhTcVk2MPmtb9y93-9Fs3yiej8hBtLF60_N_a6aWDg9Mrbm18nP-2dTVvTA6h77eJZrOJICzgN3dZyPT4AN1ffQ
X-GData-Client: ytapi-SourceRH-LaCartoonerie-3lludu8g-0
X-GData-Key:
key=AI39si44WZavBNwYryVhVFaMH4Y8e0JbTAr83bScAxKby6LBW3xEyBzaXrV7MTw3sm56SmYVhSOWRXNfUrS0sqC1i7313ycFrQ
Slug: c447e7c1c0b79e8dc97c76cdc16e9843.gif

-cefe168b3cb99683a0f9ebd6f9b2cca6
Content-Type: application/atom+xml; charset=UTF-8


http://www.w3.org/2005/Atom";
xmlns:media="http://search.yahoo.com/mrss/";
xmlns:yt="http://gdata.youtube.com/schemas/2007";>
  
title foo
description foo
http://gdata.youtube.com/schemas/2007/categories.cat";>People
key1, key2
  


-cefe168b3cb99683a0f9ebd6f9b2cca6
Content-Type: video/gif
Content-Transfer-Encoding: binary

XXX
-cefe168b3cb99683a0f9ebd6f9b2cca6--

Actual result:
--
The actual result, found with a sniffer (wireshark for example) is:

PHP CLIENT => YOUTUBE SERVER:
POST
/feeds/api/users/bigbluezen/uploads/wFqcFtuB9MY?client=ytapi-SourceRH-LaCartoonerie-3lludu8g-0
HTTP/1.0
Host: gdata.youtube.com
Authorization: GoogleLogin
auth=AIwbFASurkAdrgigXGJeP24Ebc0dM7EierouUTZ7Nqm2pjSzo2aRtNXQgOo-_ebco_-w7CmpxcZqysZKS_UGCUSc-K6tD5NI84jIc7sf1Sq8cPtcbknOrvlqxF6PNBj-kLzeXEPnBwKoE4vJDuwE0ag7Aleyo-u3hw
X-GData-Client: ytapi-SourceRH-LaCartoonerie-3lludu8g-0
X-GData-Key:
key=AI39si44WZavBNwYryVhVFaMH4Y8e0JbTAr83bScAxKby6LBW3xEyBzaXrV7MTw3sm56SmYVhSOWRXNfUrS0sqC1i7313ycFrQ
Slug:
c447e7c1c0b79e8dc97c76cdc16e9843.gifbScAxKby6LBW3xEyBzaXrV7MTw3sm56SmYVhSOWRXNfUrS0sqC1i7313ycFrQ
Slug: c447e7c1c0b79e8dc97c76cdc16e9843.gif

EOF

As you can see, the first query is completely messy !!

The funny thing is that: if i change '' to '' at line 64, the http query is good...

One could thing  in the xml and change another things (add an echo
somewhere, but this trick doesn't work all the time)

As the result is very random, i think file_get_contents doesn't get all
data from the string, leaving some \r\n, which mess the following http
query, maybe something like that...


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



#43920 [Opn]: Here is the xml file for the test case

2008-01-23 Thread jdespatis at yahoo dot fr
 ID:   43920
 User updated by:  jdespatis at yahoo dot fr
 Reported By:  jdespatis at yahoo dot fr
 Status:   Open
 Bug Type: Regexps related
 Operating System: Linux Debian
 PHP Version:  5.2.5
 New Comment:

You can also retrieve this xml file at this address:
http://www.despatis.com/1087985.xml

As i don't find the way to add an attachment on this bug report..


Previous Comments:


[2008-01-23 12:05:39] jdespatis at yahoo dot fr

capture_musicscene id=23lak_scene.initialize1
music_init_p=0lak_scene.initialize2
music=_level0.player_mc.scene_builder.musicload_init track=0capture_update_timer
NaNplay_moviecapture_start_timer
64683capture_update_timer 51capture_update_timer 270capture_update_timer
403capture_update_timer 536capture_update_timer 668capture_update_timer
800capture_update_timer 927capture_update_timer 1063capture_update_timer 1199capture_update_timer 1327capture_update_timer 1459capture_update_timer 1592capture_update_timer 1732capture_update_timer 1858capture_update_timer 1991capture_update_timer 2119capture_update_timer 2251capture_update_timer 2379capture_update_timer 2516capture_update_timer 2644capture_update_timer 2776capture_update_timer 2903capture_update_timer 3035capture_update_timer 3170capture_update_timer 3304capture_update_timer 3435capture_update_timer 3566capture_update_timer 3700capture_update_timer 3828capture_update_timer 3959capture_update_timer 4095capture_update_timer 4231capture_update_timer 4363capture_update_timer 4491capture_update_timer 4616capture_update_timer 4744capture_update_timer 4880capture_update_timer 5011capture_update_timer 5143capture_update_timer 5279update null,11,2 track_id=0capture_update_timer 5411capture_update_timer 5540capture_update_timer 5676capture_update_timer 5804loop_voice
_level0.player_mc.scene_builder.scene.decor.elem8.tetecapture_update_timer 5942capture_update_timer 6075capture_update_timer 6212capture_update_timer 6346capture_update_timer 6479capture_update_timer 6604capture_update_timer 6732capture_update_timer 6868capture_update_timer 7004capture_update_timer 7131capture_update_timer 7267capture_update_timer 7403capture_update_timer 7528capture_update_timer 7656loop_voice
_level0.player_mc.scene_builder.scene.decor.elem9.tetecapture_update_timer 7795capture_update_timer 7928capture_update_timer 8053capture_update_timer 8186capture_update_timer 8315capture_update_timer 8447update null,11,2
track_id=0capture_update_timer 8576capture_update_timer 8704capture_update_timer 8840capture_update_timer 8970capture_update_timer 9107capture_update_timer 9233capture_update_timer 9360capture_update_timer 9491capture_update_timer 9616capture_update_timer 9748update null,43,3
track_id=0capture_update_timer 9880capture_update_timer 10015capture_update_timer 10151capture_update_timer 10288capture_update_timer 10415capture_update_timer 10548capture_update_timer 10684capture_update_timer 10820capture_update_timer 10951capture_update_timer 11087capture_update_timer 11216capture_update_timer 11346capture_update_timer 11475capture_update_timer 11606update
null,11,2 track_id=0capture_update_timer 11732capture_update_timer 11865capture_update_timer 11992capture_update_timer 12127capture_update_timer 12255capture_update_timer 12387capture_update_timer 12516loop_voice
_level0.player_mc.scene_builder.scene.decor.elem8.tetecapture_update_timer 12660capture_update_timer 12780capture_update_timer 12915loop_voice
_level0.player_mc.scene_builder.scene.decor.elem8.tetecapture_update_timer 13052capture_update_timer 13176capture_update_timer 13304capture_update_timer 13439capture_update_timer 13564loop_voice
_level0.player_mc.scene_builder.scene.decor.elem9.tetecapture_update_timer 13705capture_update_timer 13837capture_update_timer 13963capture_update_timer 14105capture_update_timer 14239capture_update_timer 14369capture_update_timer 14504capture_update_timer 14628capture_update_timer 14757capture_update_timer 14892capture_update_timer 15019capture_update_timer 15147capture_update_timer 15275capture_update_timer 15403capture_update_timer 15532capture_update_timer 15664capture_update_timer 15792capture_update_timer 15928capture_update_timer 16064capture_update_timer 16199capture_update_timer 16327update
null,11,2 track_id=0capture_update_timer 16463capture_update_timer 16588capture_update_timer 16728capture_update_timer 16858capture_update_timer 16991capture_update_timer 17123capture_update_timer 17255capture_update_timer 17391capture_update_timer 17516capture_update_timer 17653capture_update_timer 17781capture_update_timer 17911capture_update_timer 18039capture_update_timer 18175capture_update_timer 18312capture_update_timer 18439capture_update_timer 18564update
null,45,3 track_id=0capture_update_timer 18692capture_update_timer 18828capture_update_timer 18963capture_update_timer 19104capture_update_timer 19234capture_update_timer 19368capture_update_

#43920 [Opn]: Here is the xml file for the test case

2008-01-23 Thread jdespatis at yahoo dot fr
 ID:   43920
 User updated by:  jdespatis at yahoo dot fr
-Summary:  preg_replace_callback is very ver slow on a 36k xml
   file
 Reported By:  jdespatis at yahoo dot fr
 Status:   Open
 Bug Type: Regexps related
 Operating System: Linux Debian
 PHP Version:  5.2.5
 New Comment:

capture_musicscene id=23lak_scene.initialize1
music_init_p=0lak_scene.initialize2
music=_level0.player_mc.scene_builder.musicload_init track=0capture_update_timer
NaNplay_moviecapture_start_timer
64683capture_update_timer 51capture_update_timer 270capture_update_timer
403capture_update_timer 536capture_update_timer 668capture_update_timer
800capture_update_timer 927capture_update_timer 1063capture_update_timer 1199capture_update_timer 1327capture_update_timer 1459capture_update_timer 1592capture_update_timer 1732capture_update_timer 1858capture_update_timer 1991capture_update_timer 2119capture_update_timer 2251capture_update_timer 2379capture_update_timer 2516capture_update_timer 2644capture_update_timer 2776capture_update_timer 2903capture_update_timer 3035capture_update_timer 3170capture_update_timer 3304capture_update_timer 3435capture_update_timer 3566capture_update_timer 3700capture_update_timer 3828capture_update_timer 3959capture_update_timer 4095capture_update_timer 4231capture_update_timer 4363capture_update_timer 4491capture_update_timer 4616capture_update_timer 4744capture_update_timer 4880capture_update_timer 5011capture_update_timer 5143capture_update_timer 5279update null,11,2 track_id=0capture_update_timer 5411capture_update_timer 5540capture_update_timer 5676capture_update_timer 5804loop_voice
_level0.player_mc.scene_builder.scene.decor.elem8.tetecapture_update_timer 5942capture_update_timer 6075capture_update_timer 6212capture_update_timer 6346capture_update_timer 6479capture_update_timer 6604capture_update_timer 6732capture_update_timer 6868capture_update_timer 7004capture_update_timer 7131capture_update_timer 7267capture_update_timer 7403capture_update_timer 7528capture_update_timer 7656loop_voice
_level0.player_mc.scene_builder.scene.decor.elem9.tetecapture_update_timer 7795capture_update_timer 7928capture_update_timer 8053capture_update_timer 8186capture_update_timer 8315capture_update_timer 8447update null,11,2
track_id=0capture_update_timer 8576capture_update_timer 8704capture_update_timer 8840capture_update_timer 8970capture_update_timer 9107capture_update_timer 9233capture_update_timer 9360capture_update_timer 9491capture_update_timer 9616capture_update_timer 9748update null,43,3
track_id=0capture_update_timer 9880capture_update_timer 10015capture_update_timer 10151capture_update_timer 10288capture_update_timer 10415capture_update_timer 10548capture_update_timer 10684capture_update_timer 10820capture_update_timer 10951capture_update_timer 11087capture_update_timer 11216capture_update_timer 11346capture_update_timer 11475capture_update_timer 11606update
null,11,2 track_id=0capture_update_timer 11732capture_update_timer 11865capture_update_timer 11992capture_update_timer 12127capture_update_timer 12255capture_update_timer 12387capture_update_timer 12516loop_voice
_level0.player_mc.scene_builder.scene.decor.elem8.tetecapture_update_timer 12660capture_update_timer 12780capture_update_timer 12915loop_voice
_level0.player_mc.scene_builder.scene.decor.elem8.tetecapture_update_timer 13052capture_update_timer 13176capture_update_timer 13304capture_update_timer 13439capture_update_timer 13564loop_voice
_level0.player_mc.scene_builder.scene.decor.elem9.tetecapture_update_timer 13705capture_update_timer 13837capture_update_timer 13963capture_update_timer 14105capture_update_timer 14239capture_update_timer 14369capture_update_timer 14504capture_update_timer 14628capture_update_timer 14757capture_update_timer 14892capture_update_timer 15019capture_update_timer 15147capture_update_timer 15275capture_update_timer 15403capture_update_timer 15532capture_update_timer 15664capture_update_timer 15792capture_update_timer 15928capture_update_timer 16064capture_update_timer 16199capture_update_timer 16327update
null,11,2 track_id=0capture_update_timer 16463capture_update_timer 16588capture_update_timer 16728capture_update_timer 16858capture_update_timer 16991capture_update_timer 17123capture_update_timer 17255capture_update_timer 17391capture_update_timer 17516capture_update_timer 17653capture_update_timer 17781capture_update_timer 17911capture_update_timer 18039capture_update_timer 18175capture_update_timer 18312capture_update_timer 18439capture_update_timer 18564update
null,45,3 track_id=0capture_update_timer 18692capture_update_timer 18828capture_update_timer 18963capture_update_timer 19104capture_update_timer 19234capture_update_timer 19368capture_update_timer 19500capture_update_timer 19628capture_update_timer 19764capture_update_timer 19896capture_update_timer 20023capture_update_timer 20151capture_update_timer 20279capture_update_timer 20415capture_update_timer

#43920 [NEW]: preg_replace_callback is very ver slow on a 36k xml file

2008-01-23 Thread jdespatis at yahoo dot fr
From: jdespatis at yahoo dot fr
Operating system: Linux Debian
PHP version:  5.2.5
PHP Bug Type: Regexps related
Bug description:  preg_replace_callback is very ver slow on a 36k xml file

Description:

I have a 36k xml file
I launch preg_replace_callback on it, but php runs crazy 99% CPU




Reproduce code:
---
test case try this code with the 1087985.xml i give in attachment:

the aim is to cut the string ended by \r or \n or \x0, and launch a
specific function (protocol_analyse) on each message



Expected result:

I expect the function to returns quick, but 99% CPU taken

Actual result:
--
Duration : 133.00 sec which is very very slow



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


#40649 [Fbk->Opn]: Void Soap function can't return SegFault

2007-02-26 Thread jdespatis at yahoo dot fr
 ID:   40649
 User updated by:  jdespatis at yahoo dot fr
 Reported By:  jdespatis at yahoo dot fr
-Status:   Feedback
+Status:   Open
 Bug Type: SOAP related
 Operating System: Linux 2.6.18 Debian
 PHP Version:  5.2.1
 New Comment:

Exactly the same problem with the last last php snapshot you provide.

But this bug is quite old, i've detected in php 5.1.3 and upper

(i sticked to php5.1.2 to avoid this bug, but now i need to use php5.2)


Previous Comments:


[2007-02-26 19:24:39] [EMAIL PROTECTED]

Please try using this CVS snapshot:

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





[2007-02-26 19:19:25] jdespatis at yahoo dot fr

Description:

I have a client and server soap which worked with php 5.1.2, but
whenever i upgrade to php > 5.1.2, this code doesn't work anymore.

It's a simple client and server soap.

After debugging, the problem comes from the fact that if no  is provided to a function to explain the output,
then this function always sends null

Even if the function throws an exception

It seems that php <= 5.1.2 was adding a default output function so that
exceptions could be throwed

Reproduce code:
---
When using the simple client :
http://www.despatis.com/client.phps

with the simple soap server:
http://www.despatis.com/soap_server.phps

and with the wsdl:
http://www.despatis.com/Webservices.wsdl

(to make the code work, the good wsdl to use
is:http://www.despatis.com/Webservices2.wsdl, however this code should
work with a minimal Webservices.wsdl, that doesn't provide information
on output function as the function is a void function !)

Expected result:

client.php should print:

Request :

http://schemas.xmlsoap.org/soap/envelope/";
xmlns:ns1="urn:xmethods" xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>pifpuf

Response:

http://schemas.xmlsoap.org/soap/envelope/";>SOAP-ENV:ServerException
throwed


Actual result:
--
Actual result is:

Request :

http://schemas.xmlsoap.org/soap/envelope/";
xmlns:ns1="urn:xmethods" xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>pifpuf

Response:







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


#40649 [NEW]: Void Soap function can't return SegFault

2007-02-26 Thread jdespatis at yahoo dot fr
From: jdespatis at yahoo dot fr
Operating system: Linux 2.6.18 Debian
PHP version:  5.2.1
PHP Bug Type: SOAP related
Bug description:  Void Soap function can't return SegFault

Description:

I have a client and server soap which worked with php 5.1.2, but whenever
i upgrade to php > 5.1.2, this code doesn't work anymore.

It's a simple client and server soap.

After debugging, the problem comes from the fact that if no  is provided to a function to explain the output, then
this function always sends null

Even if the function throws an exception

It seems that php <= 5.1.2 was adding a default output function so that
exceptions could be throwed

Reproduce code:
---
When using the simple client :
http://www.despatis.com/client.phps

with the simple soap server:
http://www.despatis.com/soap_server.phps

and with the wsdl:
http://www.despatis.com/Webservices.wsdl

(to make the code work, the good wsdl to use
is:http://www.despatis.com/Webservices2.wsdl, however this code should
work with a minimal Webservices.wsdl, that doesn't provide information on
output function as the function is a void function !)

Expected result:

client.php should print:

Request :

http://schemas.xmlsoap.org/soap/envelope/";
xmlns:ns1="urn:xmethods" xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>pifpuf

Response:

http://schemas.xmlsoap.org/soap/envelope/";>SOAP-ENV:ServerException
throwed


Actual result:
--
Actual result is:

Request :

http://schemas.xmlsoap.org/soap/envelope/";
xmlns:ns1="urn:xmethods" xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/";
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>pifpuf

Response:



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


#31862 [Com]: Ability to turn off magic_quotes for parse_str().

2006-12-14 Thread jdespatis at yahoo dot fr
 ID:   31862
 Comment by:   jdespatis at yahoo dot fr
 Reported By:  php at koterov dot ru
 Status:   Open
 Bug Type: Feature/Change Request
 Operating System: all
 PHP Version:  4.3.10
 New Comment:

Hi, i have the same need

In fact, I encode an array into a query string thanks to
http_build_query()

and i want to get my array back, so i use parse_str, however, this
function protects slash if magic quotes is ON

AND it's impossible in a script to set the magic quotes to off, so it's
impossible to tell parse_str not to protect the slashes, i have to do a
little loop after to strip slashes

Should be nice to add an extra param to this function to say if yes or
no slashes should be protected, instead of using the configuration of
magic quotes (that can't be changed at runtime)


Previous Comments:


[2005-02-06 20:54:30] php at koterov dot ru

Description:

parse_str() always quotes arguments when magic_quotes_gpc is active on
startup (php.ini or .htaccess configured). But seems I cannot SWITCH
OFF magic_quotes_gpc on runtime FOR parse_str(). (I understand that it
is useless to try to switch off magic_quotes_gpc for purposes other
than parse_str!).

Seems it's a restriction of ini_set(), not parse_str() itself.

Reproduce code:
---
".print_r($p, 1)."";
?>

Expected result:

Array
(
[a] => "b"
)



Actual result:
--
Array
(
[a] => \"b\"
)







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


#37794 [Bgs]: preg_split doesn't work as it should be with \W on utf-8 string

2006-06-14 Thread jdespatis at yahoo dot fr
 ID:   37794
 User updated by:  jdespatis at yahoo dot fr
 Reported By:  jdespatis at yahoo dot fr
 Status:   Bogus
 Bug Type: PCRE related
 Operating System: Linux 2.6.15 Debian Testing
 PHP Version:  5.1.4
 New Comment:

Ok.
However i've read again the documentation
http://fr.php.net/manual/en/reference.pcre.pattern.syntax.php

And i don't see it's explicitely said "in utf-8 mode don't use \w"
i can only see: "Since PHP 4.4.0 and 5.1.0, three additional escape
sequences to match generic character types are available when UTF-8
mode is selected. "

So, a reader understand this as: \w works AND in utf8 i have also \p{}

Would it be possible to update the documentation ? (for example, now, i
have a doubt on \d, is it working on utf8 ?, i dunno...)

One thing more: i've found that ucwords() and ucfirst() are not utf8
aware, the documentation should be updated i think

Thanks


Previous Comments:


[2006-06-13 21:08:46] [EMAIL PROTECTED]

sorry, my last comment is incorrect. in utf mode you should use the
property escapes (\p{..}), instead of non utf8-aware escapes, like \W.



[2006-06-13 18:35:27] [EMAIL PROTECTED]

/\W/ means match any non-whitespace. you probably want to use \w (lower
case)

------------

[2006-06-13 11:53:50] jdespatis at yahoo dot fr

Description:

preg_split("/\W/u", $utf8_string) cuts the words !

Reproduce code:
---
print_r(preg_split("/(\W)/u", "этот", -1,
PREG_SPLIT_DELIM_CAPTURE));

(watch out, i've put an utf8 string (you need to translate the html
code into utf8), it's a russian string, (when you see the characters,
you can see etot, with e being an epsilon inverted)

For now, i succeed in making my code work by using:
\P{L} instead of \W

Expected result:

Array
(
[0] => этот
)

Actual result:
--
Array
(
[0] =>
[1] => э
[2] =>
[3] => т
[4] =>
[5] => о
[6] =>
[7] => т
[8] =>
)





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


#37794 [NEW]: preg_split doesn't work as it should be with \W on utf-8 string

2006-06-13 Thread jdespatis at yahoo dot fr
From: jdespatis at yahoo dot fr
Operating system: Linux 2.6.15 Debian Testing
PHP version:  5.1.4
PHP Bug Type: mbstring related
Bug description:  preg_split doesn't work as it should be with \W on utf-8 
string

Description:

preg_split("/\W/u", $utf8_string) cuts the words !

Reproduce code:
---
print_r(preg_split("/(\W)/u", "этот", -1,
PREG_SPLIT_DELIM_CAPTURE));

(watch out, i've put an utf8 string (you need to translate the html code
into utf8), it's a russian string, (when you see the characters, you can
see etot, with e being an epsilon inverted)

For now, i succeed in making my code work by using:
\P{L} instead of \W

Expected result:

Array
(
[0] => этот
)

Actual result:
--
Array
(
[0] =>
[1] => э
[2] =>
[3] => т
[4] =>
[5] => о
[6] =>
[7] => т
[8] =>
)

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