Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit 0a6bf6e

Browse files
committed
Merge pull request zendframework/zendframework#2210 from weierophinney/hotfix/remove-suppression-operator
Get rid of error suppression

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/Helper/Navigation/Sitemap.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use RecursiveIteratorIterator;
1515
use Zend\Navigation\AbstractContainer;
1616
use Zend\Navigation\Page\AbstractPage;
17+
use Zend\Stdlib\ErrorHandler;
1718
use Zend\Uri;
1819
use Zend\View;
1920
use Zend\View\Exception;
@@ -422,11 +423,14 @@ public function getDomSitemap(AbstractContainer $container = null)
422423

423424
// validate using schema if specified
424425
if ($this->getUseSchemaValidation()) {
425-
if (!@$dom->schemaValidate(self::SITEMAP_XSD)) {
426+
ErrorHandler::start();
427+
$test = $dom->schemaValidate(self::SITEMAP_XSD);
428+
$error = ErrorHandler::stop();
429+
if (!$test) {
426430
throw new Exception\RuntimeException(sprintf(
427431
'Sitemap is invalid according to XML Schema at "%s"',
428432
self::SITEMAP_XSD
429-
));
433+
), 0, $error);
430434
}
431435
}
432436

0 commit comments

Comments
 (0)