Skip to content
This repository was archived by the owner on May 16, 2018. It is now read-only.

Commit 8281917

Browse files
committed
Merge branch 'hotfix/293'
Fixes issues seen in #293
2 parents 9ef9d52 + 4d75497 commit 8281917

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ tests/Zend/OpenId/_files/*
77
tests/Zend/Translate/Adapter/_files/zend_cache---internal-metadatas---testid
88
tests/Zend/Translate/Adapter/_files/zend_cache---testid
99
vendor/*
10+
composer.lock
11+
bin/dbunit
12+
bin/phpunit

library/Zend/Xml/Security.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ protected static function heuristicScan($xml)
5151
* @param integer $errline
5252
* @return bool
5353
*/
54-
protected static function _loadXmlErrorHandler($errno, $errstr, $errfile, $errline)
54+
public static function loadXmlErrorHandler($errno, $errstr, $errfile, $errline)
5555
{
5656
if (substr_count($errstr, 'DOMDocument::loadXML()') > 0) {
5757
return true;
@@ -88,7 +88,7 @@ public static function scan($xml, DOMDocument $dom = null)
8888

8989
// Load XML with network access disabled (LIBXML_NONET)
9090
// error disabled with @ for PHP-FPM scenario
91-
set_error_handler(array('Zend_Xml_Security', '_loadXmlErrorHandler'), E_WARNING);
91+
set_error_handler(array('Zend_Xml_Security', 'loadXmlErrorHandler'), E_WARNING);
9292

9393
$result = $dom->loadXml($xml, LIBXML_NONET);
9494
restore_error_handler();

tests/Zend/Xml/SecurityTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function testScanSimpleXmlResult()
9090
{
9191
$result = Zend_Xml_Security::scan($this->_getXml());
9292
$this->assertTrue($result instanceof SimpleXMLElement);
93-
$this->assertEquals($result->result, 'test');
93+
$this->assertEquals((string) $result->result, 'test');
9494
}
9595

9696
public function testScanDom()
@@ -130,7 +130,7 @@ public function testScanFile()
130130

131131
$result = Zend_Xml_Security::scanFile($file);
132132
$this->assertTrue($result instanceof SimpleXMLElement);
133-
$this->assertEquals($result->result, 'test');
133+
$this->assertEquals((string) $result->result, 'test');
134134
unlink($file);
135135
}
136136

0 commit comments

Comments
 (0)