Bug #65045 [Fbk-Csd]: mb_convert_encoding breaks well-formed character

2013-06-30 Thread hirokawa
Edit report at https://bugs.php.net/bug.php?id=65045edit=1

 ID: 65045
 Updated by: hirok...@php.net
 Reported by:masakielastic at gmail dot com
 Summary:mb_convert_encoding breaks well-formed character
-Status: Feedback
+Status: Closed
 Type:   Bug
 Package:mbstring related
 Operating System:   Mac OSX
 PHP Version:5.5.0RC3
 Assigned To:hirokawa
 Block user comment: N
 Private report: N

 New Comment:

Automatic comment on behalf of hirokawa
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=c6a7549efcca62346687b0fda5b408b963f5ab2d
Log: fixed #65045: mb_convert_encoding breaks well-formed character.


Previous Comments:

[2013-06-30 02:49:42] hirok...@php.net

This problem is caused by ill-formed utf-8 handling issue of libmbfl.
libmbfl is maintaining at https://github.com/moriyoshi/libmbfl.
Please try to use the newest version of libmbfl on github.


[2013-06-22 14:02:28] a...@php.net

Related To: Bug #65081


[2013-06-17 12:30:10] a...@php.net

I can reproduce that on windows too, the issue is probably not only osx. Here's 
slightly modified snippet:

?php

$str1 = \xF0\xA4\xAD . \xF0\xA4\xAD\xA2 . \xF0\xA4\xAD\xA2;
$exp1 = \xEF\xBF\xBD . \xF0\xA4\xAD\xA2 . \xF0\xA4\xAD\xA2;

if (true !== mb_substitute_character(0xFFFD)) {
die(can't set substitute char\n);
}

print_hex($str1);
$s = mb_convert_encoding($str1, 'UTF-8', mb_detect_encoding($str1));
print_hex($s);

function print_hex($s)
{
for ($i = 0; $i  strlen($s); $i++) {
echo 0x, dechex(ord($s[$i])),  ;
}
echo \n;
}

?

And the output (added pipes as utf8 char separators manually)

0xf0 0xa4 0xad | 0xf0 0xa4 0xad 0xa2 | 0xf0 0xa4 0xad 0xa2

0xef 0xbf 0xbd | 0xef 0xbf 0xbd | 0xef 0xbf 0xbd | 0xef 0xbf 0xbd | 0xf0 0xa4 
0xad 0xa2

As one can see, the first original invalid 3 byte sequence and the second valid 
4 byte sequence are replaced with 0xef 0xbf 0xbd, the last one remains. 
However looking at the codes only libmfl is in the game 
there http://lxr.php.net/xref/PHP_5_5/ext/mbstring/mbstring.c#3011 . Not sure 
yet to have overseen something, have to make a C 
snippet.


[2013-06-16 23:17:01] masakielastic at gmail dot com

Description:

When converting string from UTF-8 to UTF-8 by using mb_convert_encoding for 
replacing ill-formed byte sequence with the substitute character(U+FFFD), 
mb_convert_encoding replaces the character follwing ill-formed byte sequence 
with 
the substitute character. mb_convert_encoding also delete trailing ill-formed 
byte 
sequence and doesn't replace it with the substitute character.

The comprehensive test case for 2-4 byte 
characters is here: https://gist.github.com/masakielastic/5793665 .

Test script:
---
// U+24B62: \xF0\xA4\xAD\xA2
// ill-formed: \xF0\xA4\xAD
// U+FFFD: \xEF\xBF\xBD

$str = \xF0\xA4\xAD.  \xF0\xA4\xAD\xA2.\xF0\xA4\xAD\xA2;
$expected = \xEF\xBF\xBD.\xF0\xA4\xAD\xA2.\xF0\xA4\xAD\xA2;

$str2 = \xF0\xA4\xAD\xA2.\xF0\xA4\xAD\xA2.\xF0\xA4\xAD;
$expected2 = \xF0\xA4\xAD\xA2.\xF0\xA4\xAD\xA2.\xEF\xBF\xBD;

mb_substitute_character(0xFFFD);
var_dump(
$expected === htmlspecialchars_decode(htmlspecialchars($str, 
ENT_SUBSTITUTE, 'UTF-8')),
$expected2 === htmlspecialchars_decode(htmlspecialchars($str2, 
ENT_SUBSTITUTE, 'UTF-8')), 
$expected === mb_convert_encoding($str, 'UTF-8', 'UTF-8'),
$expected2 === mb_convert_encoding($str2, 'UTF-8', 'UTF-8')
);

Expected result:

bool(true)
bool(true)
bool(true)
bool(true)

Actual result:
--
bool(true)
bool(true)
bool(false)
bool(false)






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


Bug #64078 [Com]: cli.prompt weird trailing spaces behavior on interactive shell

2013-06-30 Thread oliver at x10 dot pe
Edit report at https://bugs.php.net/bug.php?id=64078edit=1

 ID: 64078
 Comment by: oliver at x10 dot pe
 Reported by:oliver at x10 dot pe
 Summary:cli.prompt weird trailing spaces behavior on
 interactive shell
 Status: Open
 Type:   Bug
 Package:CGI/CLI related
 Operating System:   Ubuntu Linux 12.10 64bits
 PHP Version:5.4.11
 Block user comment: N
 Private report: N

 New Comment:

Problem persists on PHP 5.5.0


Previous Comments:

[2013-01-25 22:58:56] oliver at x10 dot pe

Description:

Hello everyone.

When I try to change the interactive shell prompt using the command line (via 
the 
-d option), the trailing spaces doesn't show unless I begin the prompt with an 
non-alphanumeric character.

It works OK using the shorthand notation (#cli.prompt=test  ) inside the 
shell

Test script:
---
$ php -d cli.prompt=test-a
Interactive shell

test# spaces are not shown
test^C

$ php -d cli.prompt=-test-a
Interactive shell

-test   # now the prompt is ok
-test   ^C

$ php -d cli.prompt= test-a
Interactive shell

 test   # also ok
 test   ^C


Expected result:

$ php -d cli.prompt=test-a
Interactive shell

test   # The trailing spaces should be honored.
test   ^C

Actual result:
--
$ php -d cli.prompt=test-a
Interactive shell

test# not honored
test^C







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


[PHP-BUG] Bug #65168 [NEW]: segfault when __toString() returns $this

2013-06-30 Thread oliver at x10 dot pe
From: oliver at x10 dot pe
Operating system: Xubuntu 12.10 64bits
PHP version:  master-Git-2013-06-30 (Git)
Package:  Class/Object related
Bug Type: Bug
Bug description:segfault when __toString() returns $this

Description:

Hi,

Casting $this as string inside __toString() magic function makes php crash.
It 
seems it ran into an infinite loop. 

Tested on PHP 5.5 and 5.4.11, even 5.3.6

Test script:
---
class base {
function __toString() {
return $this;
}
}
echo new base();

Expected result:

Exception thrown, or an error message.

Actual result:
--
Violación de segmento (`core' generado)

[Segmentation Fault ('core' dumped)]

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



Bug #65168 [Opn]: segfault when __toString() returns $this

2013-06-30 Thread laruence
Edit report at https://bugs.php.net/bug.php?id=65168edit=1

 ID: 65168
 Updated by: larue...@php.net
 Reported by:oliver at x10 dot pe
 Summary:segfault when __toString() returns $this
 Status: Open
 Type:   Bug
 Package:Class/Object related
 Operating System:   Xubuntu 12.10 64bits
 PHP Version:master-Git-2013-06-30 (Git)
 Block user comment: N
 Private report: N

 New Comment:

actually, this is not a returning problem,

return $this is same as return strval($this), 

so, it's the same as return $this-__toString.

it's a stack overflow segfault


Previous Comments:

[2013-06-30 15:54:07] oliver at x10 dot pe

Description:

Hi,

Casting $this as string inside __toString() magic function makes php crash. It 
seems it ran into an infinite loop. 

Tested on PHP 5.5 and 5.4.11, even 5.3.6

Test script:
---
class base {
function __toString() {
return $this;
}
}
echo new base();

Expected result:

Exception thrown, or an error message.

Actual result:
--
Violación de segmento (`core' generado)

[Segmentation Fault ('core' dumped)]






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


Bug #65168 [Opn]: segfault when __toString() returns $this

2013-06-30 Thread laruence
Edit report at https://bugs.php.net/bug.php?id=65168edit=1

 ID: 65168
 Updated by: larue...@php.net
 Reported by:oliver at x10 dot pe
 Summary:segfault when __toString() returns $this
 Status: Open
 Type:   Bug
 Package:Class/Object related
 Operating System:   Xubuntu 12.10 64bits
 PHP Version:master-Git-2013-06-30 (Git)
 Block user comment: N
 Private report: N

 New Comment:

oh, there was a mistake, that is, after we have stackless user function call

return $this should be same as return call_user_func(array($this, 
__toString));


Previous Comments:

[2013-06-30 16:44:09] larue...@php.net

actually, this is not a returning problem,

return $this is same as return strval($this), 

so, it's the same as return $this-__toString.

it's a stack overflow segfault


[2013-06-30 15:54:07] oliver at x10 dot pe

Description:

Hi,

Casting $this as string inside __toString() magic function makes php crash. It 
seems it ran into an infinite loop. 

Tested on PHP 5.5 and 5.4.11, even 5.3.6

Test script:
---
class base {
function __toString() {
return $this;
}
}
echo new base();

Expected result:

Exception thrown, or an error message.

Actual result:
--
Violación de segmento (`core' generado)

[Segmentation Fault ('core' dumped)]






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


Bug #65168 [Opn]: segfault when __toString() returns $this

2013-06-30 Thread oliver at x10 dot pe
Edit report at https://bugs.php.net/bug.php?id=65168edit=1

 ID: 65168
 User updated by:oliver at x10 dot pe
 Reported by:oliver at x10 dot pe
 Summary:segfault when __toString() returns $this
 Status: Open
 Type:   Bug
 Package:Class/Object related
 Operating System:   Xubuntu 12.10 64bits
 PHP Version:master-Git-2013-06-30 (Git)
 Block user comment: N
 Private report: N

 New Comment:

laruence, yep I realized I described wrong the bug in the subject after sending 
it .


Previous Comments:

[2013-06-30 16:46:37] larue...@php.net

oh, there was a mistake, that is, after we have stackless user function call

return $this should be same as return call_user_func(array($this, 
__toString));


[2013-06-30 16:44:09] larue...@php.net

actually, this is not a returning problem,

return $this is same as return strval($this), 

so, it's the same as return $this-__toString.

it's a stack overflow segfault


[2013-06-30 15:54:07] oliver at x10 dot pe

Description:

Hi,

Casting $this as string inside __toString() magic function makes php crash. It 
seems it ran into an infinite loop. 

Tested on PHP 5.5 and 5.4.11, even 5.3.6

Test script:
---
class base {
function __toString() {
return $this;
}
}
echo new base();

Expected result:

Exception thrown, or an error message.

Actual result:
--
Violación de segmento (`core' generado)

[Segmentation Fault ('core' dumped)]






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


Req #54741 [Com]: PHP 6 DEV TEST OK BUT MISSING SOME THINGS

2013-06-30 Thread annettelayne at whale-mail dot com
Edit report at https://bugs.php.net/bug.php?id=54741edit=1

 ID: 54741
 Comment by: annettelayne at whale-mail dot com
 Reported by:nuno dot ribeiro at masterd dot pt
 Summary:PHP 6 DEV TEST OK BUT MISSING SOME THINGS
 Status: Not a bug
 Type:   Feature/Change Request
 Package:IIS related
 Operating System:   WIN2008 SERVER
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

Terrific work! That is the type of information that are supposed to be shared 
around the internet. Shame on the seek engines for no longer positioning this 
put up higher! Come on over and talk over with my site . Thanks =)


Previous Comments:

[2013-05-24 02:18:29] michaela-hartnett at allmail dot net

I almost never leave remarks, but i did some searching and wound up here PHP :: 
Request #54741 :: PHP 6 DEV TEST OK BUT MISSING SOME THINGS. And I actually do 
have a couple of questions for you if it's allright. Is it simply me or does it 
appear like some of these remarks look like written by brain dead folks? :-P 
And, if you are writing on additional sites, I'd like to follow everything 
fresh you have to post. Could you list of the complete urls of all your 
community sites like your Facebook page, twitter feed, or linkedin profile?


[2013-05-24 02:18:29] michaela-hartnett at allmail dot net

Related To: Bug #54741


[2011-05-16 01:53:27] nuno dot ribeiro at masterd dot pt

YES IS THE DEV VERSION GOT IT SOME TIME NOW BUT NEVER TESTS IT ON WIN 2008,
BUT I USE A LOT ON WIN 2003, DID NOT SEE ANY REASON TO CHANGE TO PHP 5.

OK , OK .

AGAIN THANK YOU


[2011-05-16 01:45:19] paj...@php.net

There is no php version 6 (there was a plan to release one but it has been 
abandoned, that's what you use. notice the -dev in the version). Go for trunk 
if 
you want to use the edge version. 5.3.6 
is the latest release.


[2011-05-16 01:22:25] nuno dot ribeiro at masterd dot pt

BUT THANK YOU ANYWAY I WILL TAKE A LOOK TO THE LIKS YOU GIVE ME.
THANK YOU, BEST REGARDS




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

https://bugs.php.net/bug.php?id=54741


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


Bug #64046 [Com]: Segmentation fault in pcre library

2013-06-30 Thread php at richardneill dot org
Edit report at https://bugs.php.net/bug.php?id=64046edit=1

 ID: 64046
 Comment by: php at richardneill dot org
 Reported by:public at miholeus dot com
 Summary:Segmentation fault in pcre library
 Status: Not a bug
 Type:   Bug
 Package:PCRE related
 Operating System:   Ubuntu 12.04.1 LTS
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

I've just been bitten by this bug too.

It manifests as Connection Reset error on the website, and this in the apache 
logs: [Sun Jun 30 20:58:07 2013] [notice] child pid 32544 exit signal 
Segmentation fault (11)

I do understand that the segfault isn't a PHP bug, but it would be really 
helpful if the error message could be more specific: something like segfault 
in PCRE at line X in file Y.


Aside: another test-case.
Here, it can be triggered by a value over about 5400:
$input='span'.str_repeat('X', 5500).'/span';
$output = preg_replace(/span(((?!(\/span)).)*)\/span/,  BEGIN \\1 END 
 ,$input);

If I reduce pcre.recursion_limit converts the segfault into a PCRE failure... 
but there is nothing that will make the RE actually work as intended. (in the 
contrived example, we can of course just use str_replace).


Previous Comments:

[2013-01-24 15:28:45] public at miholeus dot com

I understand. Thanks for reply.


[2013-01-24 08:35:09] paj...@php.net

Not a PHP bug but pcre recursion classic stack crash, see the numerous other 
reports for more info.


[2013-01-23 18:12:19] krak...@php.net

This does cause a stack overflow, for some reason the default limits for 
recursion are very high, maybe someone has an explanation of that.

You have:
/'([^'])*'/

Shouldn't that be:
/'([^']*)'/

?


[2013-01-22 13:47:19] public at miholeus dot com

Description:

The following code causes segmentation fault. You can see the code by link I've 
provided.

Test script:
---
Code http://pastebin.com/UzBjDaZU

Expected result:

no segfault

Actual result:
--
With gdb:

(gdb) run /var/www/work/crm/trunk/pcre.php
Starting program: /usr/bin/php /var/www/work/crm/trunk/pcre.php
[Thread debugging using libthread_db enabled]
Using host libthread_db library /lib/x86_64-linux-gnu/libthread_db.so.1.
[New Thread 0x7fffe42e4700 (LWP 4329)]
[Thread 0x7fffe42e4700 (LWP 4329) exited]

Program received signal SIGSEGV, Segmentation fault.
0x76d99a62 in ?? () from /lib/x86_64-linux-gnu/libpcre.so.3






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


Req #50802 [Com]: Allow disable_functions in httpd.conf

2013-06-30 Thread spamik at yum dot pl
Edit report at https://bugs.php.net/bug.php?id=50802edit=1

 ID: 50802
 Comment by: spamik at yum dot pl
 Reported by:h dot reindl at thelounge dot net
 Summary:Allow disable_functions in httpd.conf
 Status: Wont fix
 Type:   Feature/Change Request
 Package:Feature/Change Request
 Operating System:   All
 PHP Version:5.2.12
 Block user comment: N
 Private report: N

 New Comment:

disable_functions should be made PHP_INI_ALL with exception that once set in 
can't 
be set to less restrictive (like open_basedir is nowadays). Yes it is tought to 
make because of curent code, but that is no reason to reject feature request 
completly! Don't reject it, maybe some dev someday will find motivation to do 
this.


Previous Comments:

[2012-01-30 02:23:04] k dot reznichak at pcpin dot com

Hello, any updates here?

Doesn't matter if suhosin-like or any other way, this feature would 
dramatically simplify server administration and reduce costs. My current 
solution with different apache instances listening on different ports via proxy 
was pain to set up and hurts every time I manage it.

Please consider that some admins just going easy way by enabling sensitive 
functions globally for all virtual hosts causing security risk. That does not 
means PHP is insecure by itself, however it encourages people to act insecure.

Kind Regards


[2010-01-29 15:45:08] h dot reindl at thelounge dot net

 Suhosin doesn't disable functions.  
 It adds a separate blacklist 
 mechanism.  

Yes, and it works fine

 This bug was about being able to do per-request disabling 
 with the existing disable_function mechanism.

And shows that the existing mechnism is poorly implemented if you need a 
extension to make a SECURITY-SETTING usable which is able to do nearly the same 
and would not be needed if the php-core does handle this better


[2010-01-29 15:39:30] ras...@php.net

Suhosin doesn't disable functions.  It adds a separate blacklist 
mechanism.  This bug was about being able to do per-request disabling 
with the existing disable_function mechanism.


[2010-01-29 14:43:51] h dot reindl at thelounge dot net

http://www.webhostingtalk.com/showthread.php?t=623944

If it is not possible because performance why it works with suhosin-extension 
perfectly with the only problem that function_exists() does not realize the 
suhosin setting?

Sorry, but this sounds like it's possible but i say is not because i do not 
like to touch the code


[2010-01-19 20:47:32] h dot reindl at thelounge dot net

Hm very bad - so i have three choises

* allow a function i would never like on all hosts
* make a own httpd-instance for 2 vhosts
* change the whole company-infrastructure especially adminpanel

 The performance hit would be way too high

About what time-gain are we speaking?
I can not believe that refresh this list takes a really long time
With open_basedir it works also and you have to check this before every 
fs-operation - where is the difference and would it not make sense to look how 
to optimize initalizing the functon table?

 I agree with you that the phpinfo() out is misleading, 
 but that's not what you filed a bug about.

Of course i have because i saw this day that a function is active that should 
not and i never ever would have configured the machine this way if phpinfo() 
had not shown me that the configuration is active




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

https://bugs.php.net/bug.php?id=50802


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


Bug #64046 [Nab]: Segmentation fault in pcre library

2013-06-30 Thread pajoye
Edit report at https://bugs.php.net/bug.php?id=64046edit=1

 ID: 64046
 Updated by: paj...@php.net
 Reported by:public at miholeus dot com
 Summary:Segmentation fault in pcre library
 Status: Not a bug
 Type:   Bug
 Package:PCRE related
 Operating System:   Ubuntu 12.04.1 LTS
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

@ krak...@php.net
We have no control over the segfault, if we would, it would happen in the first 
place.

You can play with the stack size (apache config), increase it and at some point 
it 
will be large enough to avoid this crash.


Previous Comments:

[2013-06-30 20:05:57] php at richardneill dot org

I've just been bitten by this bug too.

It manifests as Connection Reset error on the website, and this in the apache 
logs: [Sun Jun 30 20:58:07 2013] [notice] child pid 32544 exit signal 
Segmentation fault (11)

I do understand that the segfault isn't a PHP bug, but it would be really 
helpful if the error message could be more specific: something like segfault 
in PCRE at line X in file Y.


Aside: another test-case.
Here, it can be triggered by a value over about 5400:
$input='span'.str_repeat('X', 5500).'/span';
$output = preg_replace(/span(((?!(\/span)).)*)\/span/,  BEGIN \\1 END 
 ,$input);

If I reduce pcre.recursion_limit converts the segfault into a PCRE failure... 
but there is nothing that will make the RE actually work as intended. (in the 
contrived example, we can of course just use str_replace).


[2013-01-24 15:28:45] public at miholeus dot com

I understand. Thanks for reply.


[2013-01-24 08:35:09] paj...@php.net

Not a PHP bug but pcre recursion classic stack crash, see the numerous other 
reports for more info.


[2013-01-23 18:12:19] krak...@php.net

This does cause a stack overflow, for some reason the default limits for 
recursion are very high, maybe someone has an explanation of that.

You have:
/'([^'])*'/

Shouldn't that be:
/'([^']*)'/

?


[2013-01-22 13:47:19] public at miholeus dot com

Description:

The following code causes segmentation fault. You can see the code by link I've 
provided.

Test script:
---
Code http://pastebin.com/UzBjDaZU

Expected result:

no segfault

Actual result:
--
With gdb:

(gdb) run /var/www/work/crm/trunk/pcre.php
Starting program: /usr/bin/php /var/www/work/crm/trunk/pcre.php
[Thread debugging using libthread_db enabled]
Using host libthread_db library /lib/x86_64-linux-gnu/libthread_db.so.1.
[New Thread 0x7fffe42e4700 (LWP 4329)]
[Thread 0x7fffe42e4700 (LWP 4329) exited]

Program received signal SIGSEGV, Segmentation fault.
0x76d99a62 in ?? () from /lib/x86_64-linux-gnu/libpcre.so.3






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


[PHP-BUG] Req #65169 [NEW]: php-cgi: Content-type bfore Directive no longer available

2013-06-30 Thread spamik at yum dot pl
From: spamik at yum dot pl
Operating system: 
PHP version:  5.3.26
Package:  *General Issues
Bug Type: Feature/Change Request
Bug description:php-cgi: Content-type bfore Directive no longer available

Description:

# ./php-cgi -n a.php
X-Powered-By: PHP/5.4.16
Content-type: text/html

# ./php-cgi -n -d magic_quotes_gpc=1 a.php
br /
bFatal error/b:  Directive 'magic_quotes_gpc' is no longer available in
PHP 
in bUnknown/b on line b0/bbr /

expected:
# ./php-cgi -n -d magic_quotes_gpc=1 a.php
X-Powered-By: PHP/5.4.16
Content-type: text/html
br /
bFatal error/b:  Directive 'magic_quotes_gpc' is no longer available in
PHP 
in bUnknown/b on line b0/bbr /

Not outputing Content-type header means that apache webserver will only
return 
500 error without a webmaster actualy seeing error.


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



[PHP-BUG] Bug #65170 [NEW]: SPLHeap next() removes current node

2013-06-30 Thread mark at lange dot demon dot co dot uk
From: mark at lange dot demon dot co dot uk
Operating system: All
PHP version:  5.3.26
Package:  SPL related
Bug Type: Bug
Bug description:SPLHeap next() removes current node

Description:

When iterating through an SPLHeap, each node is removed from the heap as
you loop through to the next node.
Investigation has suggested that it is the next() method that removes the
current node before moving to the next.

Test script:
---
https://gist.github.com/MarkBaker/5896053

Expected result:

There are 7 cities in the heap
FROM NORTH TO SOUTH
Newcastle upon Tyne  +54.9833  -1.5833
Leeds+53.8100  -1.5500
Manchester   +53.4800  -2.2400
Liverpool+53.4167  -3.
Birmingham   +52.4800  -1.9100
London   +51.5171  -0.1062
Bristol  +51.4600  -2.6000
There are 7 cities in the heap

There should be the same number of city nodes in the heap after iterating
through as there were before.


Actual result:
--
There are 7 cities in the heap
FROM NORTH TO SOUTH
Newcastle upon Tyne  +54.9833  -1.5833
Leeds+53.8100  -1.5500
Manchester   +53.4800  -2.2400
Liverpool+53.4167  -3.
Birmingham   +52.4800  -1.9100
London   +51.5171  -0.1062
Bristol  +51.4600  -2.6000
There are 0 cities in the heap

However, there a 0 city nodes left in the heap after iterating through
them.

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