mirror of
https://github.com/php/php-src.git
synced 2026-03-26 17:22:15 +01:00
libxml2 expects the passed encoding to be NUL terminated, so we reject strings with NUL bytes right away. Closes GH-6899.
17 lines
492 B
PHP
17 lines
492 B
PHP
--TEST--
|
|
Bug #73246 (XMLReader: encoding length not checked)
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded("xmlreader")) die("skip xmlreader extension not available");
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
$reader = new XMLReader();
|
|
$reader->open(__FILE__, "UTF\0-8");
|
|
$reader->XML('<?xml version="1.0"?><root/>', "UTF\0-8");
|
|
?>
|
|
--EXPECTF--
|
|
Warning: XMLReader::open(): Encoding must not contain NUL bytes in %s on line %d
|
|
|
|
Warning: XMLReader::XML(): Encoding must not contain NUL bytes in %s on line %d
|