#48310 [NEW]: filter accepts invalid IPv6 address

2009-05-17 Thread geoffers+phpbugs at gmail dot com
From: geoffers+phpbugs at gmail dot com
Operating system: Mac OS 10.5.6
PHP version:  5.2.9
PHP Bug Type: Filter related
Bug description:  filter accepts invalid IPv6 address

Description:

The string '0:0:0:255.255.255.255' is not a valid IPv6 address. The 
filter extension allows it.

Reproduce code:
---
var_dump(filter_var('0:0:0:255.255.255.255', FILTER_VALIDATE_IP,
FILTER_FLAG_IPV6));

Expected result:

bool(false)

Actual result:
--
string(21) "0:0:0:255.255.255.255"

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



#48310 [Fbk->Opn]: filter accepts invalid IPv6 address

2009-05-17 Thread geoffers+phpbugs at gmail dot com
 ID:   48310
 User updated by:  geoffers+phpbugs at gmail dot com
 Reported By:  geoffers+phpbugs at gmail dot com
-Status:   Feedback
+Status:   Open
 Bug Type: Filter related
 Operating System: Mac OS 10.5.6
 PHP Version:  5.2.9
 New Comment:

Both 5.2 and 5.3 CVS give the same output as 5.2.9


Previous Comments:


[2009-05-17 16:54:29] paj...@php.net

Please try using this CVS snapshot:

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

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





[2009-05-17 16:49:39] geoffers+phpbugs at gmail dot com

Description:

The string '0:0:0:255.255.255.255' is not a valid IPv6 address. The 
filter extension allows it.

Reproduce code:
---
var_dump(filter_var('0:0:0:255.255.255.255', FILTER_VALIDATE_IP,
FILTER_FLAG_IPV6));

Expected result:

bool(false)

Actual result:
--
string(21) "0:0:0:255.255.255.255"





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



#48511 [NEW]: libxml_get_errors() returns an empty array but libxml_get_last_error() doesn't

2009-06-09 Thread geoffers+phpbugs at gmail dot com
From: geoffers+phpbugs at gmail dot com
Operating system: Mac OS 10.5.7
PHP version:  5.3CVS-2009-06-09 (CVS)
PHP Bug Type: XML Writer
Bug description:  libxml_get_errors() returns an empty array but 
libxml_get_last_error() doesn't

Description:

I would expect the last member of the array returned by
libxml_get_errors() to be equal to libxml_get_last_error(), but the former
returns an empty array while the latter returns the expected error object.

Reproduce code:
---
openMemory();
$foo->startElement("\xEF\xBF\xBF");
var_dump(libxml_get_last_error());
var_dump(libxml_get_errors());
var_dump(libxml_get_last_error() == end(libxml_get_errors()));

Expected result:

Warning: XMLWriter::startElement(): Char 0x out of allowed range in
/Users/gsnedders/Desktop/test.php on line 5

Warning: XMLWriter::startElement(): Invalid Element Name in
/Users/gsnedders/Desktop/test.php on line 5
object(LibXMLError)#2 (6) {
  ["level"]=>
  int(3)
  ["code"]=>
  int(9)
  ["column"]=>
  int(0)
  ["message"]=>
  string(33) "Char 0x out of allowed range
"
  ["file"]=>
  string(0) ""
  ["line"]=>
  int(0)
}
array(1) {
  [0]=>
  object(LibXMLError)#2 (6) {
["level"]=>
int(3)
["code"]=>
int(9)
["column"]=>
int(0)
["message"]=>
string(33) "Char 0x out of allowed range
"
["file"]=>
string(0) ""
["line"]=>
int(0)
  }
}
bool(true)

Actual result:
--
Warning: XMLWriter::startElement(): Char 0x out of allowed range in
/Users/gsnedders/Desktop/test.php on line 5

Warning: XMLWriter::startElement(): Invalid Element Name in
/Users/gsnedders/Desktop/test.php on line 5
object(LibXMLError)#2 (6) {
  ["level"]=>
  int(3)
  ["code"]=>
  int(9)
  ["column"]=>
  int(0)
  ["message"]=>
  string(33) "Char 0x out of allowed range
"
  ["file"]=>
  string(0) ""
  ["line"]=>
  int(0)
}
array(0) {
}
bool(false)

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



#45996 [Com]: libxml2 2.7.1 causes breakage with character data in xml_parse()

2009-01-02 Thread geoffers+phpbugs at gmail dot com
 ID:   45996
 Comment by:   geoffers+phpbugs at gmail dot com
 Reported By:  phpbugs at colin dot guthr dot ie
 Status:   Assigned
 Bug Type: XML related
 Operating System: Mandriva Linux
 PHP Version:  5.2.6
 Assigned To:  rrichards
 New Comment:

What is the recommended advice for PHP software that relies upon the
XML 
extension? It'd be easier to say that libxml2.7.0–2.7.2 wasn't
supported 
if it weren't for the fact that I've had at least one user come who had

LIBXML_VERSION equal to 20632 with this issue — we can't just add a 
LIBXML_VERSION based workaround, not just because the constant doesn't

exist on 4.3.0, but also because it is seemingly isn't reliable.


Previous Comments:


[2009-01-01 20:09:07] phpbugs at colin dot guthr dot ie

If the Fedora packages do not work then this is a RedHat packaging
problem and you should complain to them/open a bug etc. etc.

Like I say, in Mandriva we made sure we provided packages that worked
because they were compiled with expat.



[2009-01-01 19:31:49] alex at peoples dot ru

Thanks for advice, but I'm not guru in the Linux, as I haven't cpanel
on my server. I tried use 'yum remove' libxml2 and add new, but off
course this is stupid and doesn't work. I liked Linux, as the easiest
and powerful system, but now, I'm stock. I haven't any idea how I can
remove libxml2 and build new system with old one. One idea - change
system on Fedora 9, because FC 10 have the same bug with fucking
libxml2. Sorry, I was at Data Center 8 hours and I had problem with
servers with new system. I don't like updates now... they have bugs
every where, and I'm tiered resolve this bugs. Sorry, Have a Happy New
Year. I'll never ever will update my systems less when half year.



[2008-12-31 15:22:17] scott...@php.net

Guys please READ the report, this is a bug in libxml NOT a bug in PHP.



[2008-12-31 14:35:13] hougiwro at guerrillamail dot org

Why not just fix the bug so that existing installs can pick up a
standard update without having to rebuild the program.

Not everyone using PHP is necessarily comfortable with recompiling it
in order to implement a workaround for a bug.



[2008-12-31 13:37:17] phpbugs at colin dot guthr dot ie

If you are on a shared host with a fixed PHP version then really the
host should be responsible for deploying a well packaged version of PHP.
If they are not doing that it is the host that is at fault and you
should raise the issue with them.



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

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



#47341 [NEW]: Calling gc_collect_cycles() with zend.enable_gc=0 causes segfault

2009-02-08 Thread geoffers+phpbugs at gmail dot com
From: geoffers+phpbugs at gmail dot com
Operating system: Debian Etch
PHP version:  5.2CVS-2009-02-08 (CVS)
PHP Bug Type: Reproducible crash
Bug description:  Calling gc_collect_cycles() with zend.enable_gc=0 causes 
segfault

Description:

When running PHP with zend.enable_gc=0, a segfault occurs when trying to 
call gc_collect_cycles().

This is on Debian Etch, with everything apart from PHP 5.3 from the 
Debian stable repositories. PHP 5.3 was compiled with:

'./configure' '--enable-bcmath' '--enable-calendar' '--with-zlib-
dir=/usr' '--with-gd' '--with-apxs2=/usr/bin/apxs2' '--with-curl=/usr' 
'--without-pear' '--enable-mbstring' '--enable-debug'

I have only tested through the CLI using -d zend.enable_gc=0.

Reproduce code:
---


Expected result:

I would expect that PHP didn't crash!

Beyond that, I'd expect the result to be the same as the following when 
zend.enable_gc=1:



which is to say that it silently fails (and returns 0).

Actual result:
--
Segfault:

#0  0x08449a83 in gc_mark_roots () at /root/php5/Zend/zend_gc.c:363
#1  0x0844a05e in gc_collect_cycles () at 
/root/php5/Zend/zend_gc.c:539
#2  0x08439ab6 in zif_gc_collect_cycles (ht=0, 
return_value=0xb79301ac, return_value_ptr=0x0, this_ptr=0x0, 
return_value_used=0)
at /root/php5/Zend/zend_builtin_functions.c:336
#3  0x084536a5 in zend_do_fcall_common_helper_SPEC 
(execute_data=0xb77b8048) at /root/php5/Zend/zend_vm_execute.h:313
#4  0x084581ea in ZEND_DO_FCALL_SPEC_CONST_HANDLER 
(execute_data=0xb77b8048) at /root/php5/Zend/zend_vm_execute.h:1564
#5  0x08452ae2 in execute (op_array=0xb79307d8) at 
/root/php5/Zend/zend_vm_execute.h:104
#6  0x084286de in zend_execute_scripts (type=8, retval=0x0, 
file_count=3) at /root/php5/Zend/zend.c:1181
#7  0x083bce0c in php_execute_script (primary_file=0xbfb8bce4) at 
/root/php5/main/main.c:2147
#8  0x084b8e4b in main (argc=4, argv=0xbfb8be34) at 
/root/php5/sapi/cli/php_cli.c:1159


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



#47341 [Opn]: Calling gc_collect_cycles() with zend.enable_gc=0 causes segfault

2009-02-08 Thread geoffers+phpbugs at gmail dot com
 ID:   47341
 User updated by:  geoffers+phpbugs at gmail dot com
 Reported By:  geoffers+phpbugs at gmail dot com
 Status:   Open
 Bug Type: Reproducible crash
 Operating System: Debian Etch
-PHP Version:  5.2CVS-2009-02-08 (CVS)
+PHP Version:  5.3CVS-2009-02-08 (CVS)
 New Comment:

Woops, should be 5.3CVS not 5.2CVS


Previous Comments:


[2009-02-08 19:06:30] geoffers+phpbugs at gmail dot com

Description:

When running PHP with zend.enable_gc=0, a segfault occurs when trying
to 
call gc_collect_cycles().

This is on Debian Etch, with everything apart from PHP 5.3 from the 
Debian stable repositories. PHP 5.3 was compiled with:

'./configure' '--enable-bcmath' '--enable-calendar' '--with-zlib-
dir=/usr' '--with-gd' '--with-apxs2=/usr/bin/apxs2' '--with-curl=/usr'

'--without-pear' '--enable-mbstring' '--enable-debug'

I have only tested through the CLI using -d zend.enable_gc=0.

Reproduce code:
---


Expected result:

I would expect that PHP didn't crash!

Beyond that, I'd expect the result to be the same as the following when

zend.enable_gc=1:



which is to say that it silently fails (and returns 0).

Actual result:
--
Segfault:

#0  0x08449a83 in gc_mark_roots () at /root/php5/Zend/zend_gc.c:363
#1  0x0844a05e in gc_collect_cycles () at 
/root/php5/Zend/zend_gc.c:539
#2  0x08439ab6 in zif_gc_collect_cycles (ht=0, 
return_value=0xb79301ac, return_value_ptr=0x0, this_ptr=0x0, 
return_value_used=0)
at /root/php5/Zend/zend_builtin_functions.c:336
#3  0x084536a5 in zend_do_fcall_common_helper_SPEC 
(execute_data=0xb77b8048) at /root/php5/Zend/zend_vm_execute.h:313
#4  0x084581ea in ZEND_DO_FCALL_SPEC_CONST_HANDLER 
(execute_data=0xb77b8048) at /root/php5/Zend/zend_vm_execute.h:1564
#5  0x08452ae2 in execute (op_array=0xb79307d8) at 
/root/php5/Zend/zend_vm_execute.h:104
#6  0x084286de in zend_execute_scripts (type=8, retval=0x0, 
file_count=3) at /root/php5/Zend/zend.c:1181
#7  0x083bce0c in php_execute_script (primary_file=0xbfb8bce4) at 
/root/php5/main/main.c:2147
#8  0x084b8e4b in main (argc=4, argv=0xbfb8be34) at 
/root/php5/sapi/cli/php_cli.c:1159






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



#47343 [NEW]: gc_collect_cycles causes a segfault when called within a destructor in one case

2009-02-08 Thread geoffers+phpbugs at gmail dot com
From: geoffers+phpbugs at gmail dot com
Operating system: Debian Etch
PHP version:  5.3CVS-2009-02-08 (CVS)
PHP Bug Type: Reproducible crash
Bug description:  gc_collect_cycles causes a segfault when called within a 
destructor in one case

Description:

When running PHP a segfault occurs when trying to call 
gc_collect_cycles() within the destructor in the included code. Removing 
any line from that code (with the exception of the DONE echo) causes the 
segfault to not occur.

This is on Debian Etch, with everything apart from PHP 5.3 from the 
Debian stable repositories. PHP 5.3 was compiled with:

'./configure' '--enable-bcmath' '--enable-calendar' '--with-zlib-
dir=/usr' '--with-gd' '--with-apxs2=/usr/bin/apxs2' '--with-curl=/usr' 
'--without-pear' '--enable-mbstring' '--enable-debug'

I have only tested through the CLI.

Reproduce code:
---
data['foo'] = new B($this);
$this->data['bar'] = new B($this);
// Return either of the above
return $this->data['foo'];
}
}

class B
{
public function B($A)
{
$this->A = $A;
}

public function __destruct()
{
}
}

for ($i = 0; $i < 2; $i++)
{
$Aobj = new A;
$Bobj = $Aobj->getB();
unset($Bobj);
unset($Aobj);
}

echo "DONE\n";


Expected result:

Output:

DONE

Actual result:
--
Output:

DONE
Segmentation fault (core dumped)

Backtrace:

#0  0x0844a0b0 in gc_collect_cycles () at 
/root/php5/Zend/zend_gc.c:551
#1  0x08439ab6 in zif_gc_collect_cycles (ht=0, 
return_value=0xb79767d8, return_value_ptr=0x0, this_ptr=0x0, 
return_value_used=0)
at /root/php5/Zend/zend_builtin_functions.c:336
#2  0x084536bd in zend_do_fcall_common_helper_SPEC 
(execute_data=0xb77d604c) at /root/php5/Zend/zend_vm_execute.h:313
#3  0x08458202 in ZEND_DO_FCALL_SPEC_CONST_HANDLER 
(execute_data=0xb77d604c) at /root/php5/Zend/zend_vm_execute.h:1564
#4  0x08452afa in execute (op_array=0xb7979664) at 
/root/php5/Zend/zend_vm_execute.h:104
#5  0x0841a08a in zend_call_function (fci=0xbfe69304, 
fci_cache=0xbfe692d4) at /root/php5/Zend/zend_execute_API.c:928
#6  0x08441628 in zend_call_method (object_pp=0xbfe69394, 
obj_ce=0xb7977e94, fn_proxy=0xbfe69398, function_name=0x8902ee6 
"__destruct", 
function_name_len=10, retval_ptr_ptr=0x0, param_count=0, arg1=0x0, 
arg2=0x0) at /root/php5/Zend/zend_interfaces.c:89
#7  0x0844bb8d in zend_objects_destroy_object (object=0xb7979054, 
handle=1) at /root/php5/Zend/zend_objects.c:106
#8  0x084502d3 in zend_objects_store_call_destructors 
(objects=0x8939d80) at /root/php5/Zend/zend_objects_API.c:57
#9  0x08417947 in shutdown_destructors () at 
/root/php5/Zend/zend_execute_API.c:221
#10 0x08427ce5 in zend_call_destructors () at 
/root/php5/Zend/zend.c:867
#11 0x083bbcf4 in php_request_shutdown (dummy=0x0) at 
/root/php5/main/main.c:1506
#12 0x084b9825 in main (argc=2, argv=0xbfe69924) at 
/root/php5/sapi/cli/php_cli.c:1340

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



#50661 [NEW]: DOMDocument::loadXML does not allow UTF-16

2010-01-04 Thread geoffers+phpbugs at gmail dot com
From: geoffers+phpbugs at gmail dot com
Operating system: Mac OS 10.5.8
PHP version:  5.3SVN-2010-01-04 (SVN)
PHP Bug Type: DOM XML related
Bug description:  DOMDocument::loadXML does not allow UTF-16

Description:

DOMDocument::loadXML() does not support UTF-16 encoded XML. This breaks
the XML spec which says, "All XML processors MUST accept the UTF-8 and
UTF-16 encodings of Unicode". As such, DOMDocument::loadXML() is not a
conformant XML processor.

XMLReader supports this fine, which suggests something is wrong in the use
of the libxml2 API.

Reproduce code:
---
loadXML($data);
echo $dom->saveXML();

Expected result:




Actual result:
--
PHP Warning:  DOMDocument::loadXML(): Start tag expected, '<' not found in
Entity, line: 1 in /Users/gsnedders/Desktop/foo.php on line 5

Warning: DOMDocument::loadXML(): Start tag expected, '<' not found in
Entity, line: 1 in /Users/gsnedders/Desktop/foo.php on line 5



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



#50661 [Csd]: DOMDocument::loadXML does not allow UTF-16

2010-01-06 Thread geoffers+phpbugs at gmail dot com
 ID:   50661
 User updated by:  geoffers+phpbugs at gmail dot com
 Reported By:  geoffers+phpbugs at gmail dot com
 Status:   Closed
 Bug Type: DOM XML related
 Operating System: Mac OS 10.5.8
 PHP Version:  5.3SVN-2010-01-04 (SVN)
 Assigned To:  rrichards
 New Comment:

Null-terminated strings and UTF-16… fun. :) Thanks for fixing it!


Previous Comments:


[2010-01-06 13:16:36] rricha...@php.net

This bug has been fixed in SVN.

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





[2010-01-06 13:13:18] s...@php.net

Automatic comment from SVN on behalf of rrichards
Revision: http://svn.php.net/viewvc/?view=revision&revision=293176
Log: fix bug #50661 (DOMDocument::loadXML does not allow UTF-16)
add test



[2010-01-04 23:16:49] rricha...@php.net

Assign to self



[2010-01-04 20:58:36] geoffers+phpbugs at gmail dot com

Description:

DOMDocument::loadXML() does not support UTF-16 encoded XML. This breaks
the XML spec which says, "All XML processors MUST accept the UTF-8 and
UTF-16 encodings of Unicode". As such, DOMDocument::loadXML() is not a
conformant XML processor.

XMLReader supports this fine, which suggests something is wrong in the
use of the libxml2 API.

Reproduce code:
---
loadXML($data);
echo $dom->saveXML();

Expected result:




Actual result:
--
PHP Warning:  DOMDocument::loadXML(): Start tag expected, '<' not found
in Entity, line: 1 in /Users/gsnedders/Desktop/foo.php on line 5

Warning: DOMDocument::loadXML(): Start tag expected, '<' not found in
Entity, line: 1 in /Users/gsnedders/Desktop/foo.php on line 5







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



#50973 [NEW]: DOMDocument::saveHTML() should be able to take a node as an arg

2010-02-09 Thread geoffers+phpbugs at gmail dot com
From: geoffers+phpbugs at gmail dot com
Operating system: N/A
PHP version:  5.3SVN-2010-02-09 (SVN)
PHP Bug Type: DOM XML related
Bug description:  DOMDocument::saveHTML() should be able to take a node as an 
arg

Description:

At the moment DOMDocument::save() and DOMDocument::saveXML() both take an
optional first argument which is a node to serialize;
DOMDocument::saveHTML() and DOMDocument::saveHTMLFile() have no such option
and always serialize the whole file. For cases where HTML serialization is
needed of a specific node, all that can be done is doing it within PHP code
(which is comparatively very slow). As libxml includes the needed APIs to
do this, it doesn't appear to be overly complex to implement. I'll try to
write a patch for this later.


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



#50973 [Opn]: DOMDocument::saveHTML() should be able to take a node as an arg

2010-02-10 Thread geoffers+phpbugs at gmail dot com
 ID:   50973
 User updated by:  geoffers+phpbugs at gmail dot com
 Reported By:  geoffers+phpbugs at gmail dot com
 Status:   Open
 Bug Type: DOM XML related
 Operating System: N/A
 PHP Version:  5.3SVN-2010-02-09 (SVN)
 New Comment:

http://pastebin.ca/1792855 is a patch for this, based upon saveXML().
There is one notable difference between what I have, based on that, and
what is currently there: the if (mem) within the if (!size) is not
present within saveXML(), and nor as a result in my patch. I presume
that it should either be in both saveXML and saveHTML or neither: any
idea?

And, of course, my prior comment was wrong: it's only saveXML() which
has the argument, not save().


Previous Comments:


[2010-02-09 16:00:06] geoffers+phpbugs at gmail dot com

Description:

At the moment DOMDocument::save() and DOMDocument::saveXML() both take
an optional first argument which is a node to serialize;
DOMDocument::saveHTML() and DOMDocument::saveHTMLFile() have no such
option and always serialize the whole file. For cases where HTML
serialization is needed of a specific node, all that can be done is
doing it within PHP code (which is comparatively very slow). As libxml
includes the needed APIs to do this, it doesn't appear to be overly
complex to implement. I'll try to write a patch for this later.






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



#44648 [Com]: All-or-nothing for production checks in DOM interface

2008-04-06 Thread geoffers+phpbugs at gmail dot com
 ID:   44648
 Comment by:   geoffers+phpbugs at gmail dot com
 Reported By:  [EMAIL PROTECTED]
 Status:   Open
 Bug Type: DOM XML related
 Operating System: Windows Vista
 PHP Version:  5.2.5
 Assigned To:  rrichards
 New Comment:

While we should be throwing exceptions when strictErrorChecking is
true, 
behaviour when it is false is undefined. I would suggest in that case
to 
keep allowing everything.


Previous Comments:


[2008-04-06 04:15:54] [EMAIL PROTECTED]

You're right, that was my mistake.

I suppose that any of the places where the DOM specification could
raise an exception would be the places where there needs to be
error-checking.

Ought of curiosity, how come we don't use gdome2?



[2008-04-05 23:22:24] [EMAIL PROTECTED]

You should read the specs more closely. Names are most certainly
checked 
and a DOMException with an INVALID_CHARACTER_ERROR error is thrown.

Some of the others I need to look at because it is perfectly fine to 
create non well formed XML using DOM though it should error during 
serialization, so for those the bug would onl be in the saveXML
routine. 
Other extensions it is not a bug because non-well formed XML support is

required because the output when used in a larger context is well
formed




[2008-04-05 23:02:49] [EMAIL PROTECTED]

One more: ]]> is not allowed in CDATA blocks.

I also suspect that the other XML extensions have bugs here.



[2008-04-05 23:02:02] [EMAIL PROTECTED]

IIRC, DOM does not make any demands on names or things like that.
libxml2, which is known for its strictness, doesn't either. So, I'm
still hoping that you'll let the checks be turned off. :-)

Some things from my investigation:

- Double hyphens (--) are not allowed in comments
- Most of the text inputs don't check for UTF-8 well-formedness.
Haven't tested numeric character entities either, but those are
suspicious
- Fake namespace declarations in attributes
($d->appendChild($d->createElement('foo:bar')); results in invalid XML,
as foo namespace was never defined)

All these result in a $d->saveXML(); that is invalid XML, and probably
some more.



[2008-04-05 22:54:04] [EMAIL PROTECTED]

assign to self.

The strictness is dependent upon the DOM specs and setAttribute should

be throwing an exception in that case. While I am going to go through 
and check other methods, let me know if you come across any others that

are not validating names correctly.





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

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



#45471 [NEW]: PHP segfaults running the SimplePie test suite

2008-07-09 Thread geoffers+phpbugs at gmail dot com
From: geoffers+phpbugs at gmail dot com
Operating system: Debian Etch/Mac OS 10.5
PHP version:  5.3CVS-2008-07-09 (CVS)
PHP Bug Type: Reproducible crash
Bug description:  PHP segfaults running the SimplePie test suite

Description:

Whatever OS I attempt to run the SimplePie (trunk — the latest release 
obviously relied upon some bug in PHP and now causes a E_FATAL (which is 
really a backwards compatibility break, but I digress)) test suite on it 
results in PHP crashing. I've been unable to create a minimal test case, 
but it is entirely reproducible.

Reproduce code:
---
http://svn.simplepie.org/simplepie/trunk/test/test.php

Expected result:


…


Actual result:
--
Segfault occurs, after some output.

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



#45471 [Fbk->Csd]: PHP segfaults running the SimplePie test suite

2008-07-16 Thread geoffers+phpbugs at gmail dot com
 ID:   45471
 User updated by:  geoffers+phpbugs at gmail dot com
 Reported By:  geoffers+phpbugs at gmail dot com
-Status:   Feedback
+Status:   Closed
 Bug Type: Reproducible crash
 Operating System: Debian Etch/Mac OS 10.5
 PHP Version:  5.3CVS-2008-07-09 (CVS)
 New Comment:

It seems to have been fixed between when I reported this and now.


Previous Comments:


[2008-07-09 22:06:16] [EMAIL PROTECTED]

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

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

Please also try to reduce the size of the testcase.



[2008-07-09 21:19:07] geoffers+phpbugs at gmail dot com

Description:

Whatever OS I attempt to run the SimplePie (trunk — the latest release

obviously relied upon some bug in PHP and now causes a E_FATAL (which
is 
really a backwards compatibility break, but I digress)) test suite on
it 
results in PHP crashing. I've been unable to create a minimal test
case, 
but it is entirely reproducible.

Reproduce code:
---
http://svn.simplepie.org/simplepie/trunk/test/test.php

Expected result:


…


Actual result:
--
Segfault occurs, after some output.





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