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

Commit

Permalink
Merge pull request zendframework/zendframework#2210 from weierophinne…
Browse files Browse the repository at this point in the history
…y/hotfix/remove-suppression-operator

Get rid of error suppression
  • Loading branch information
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Helper/Navigation/Sitemap.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use RecursiveIteratorIterator;
use Zend\Navigation\AbstractContainer;
use Zend\Navigation\Page\AbstractPage;
use Zend\Stdlib\ErrorHandler;
use Zend\Uri;
use Zend\View;
use Zend\View\Exception;
Expand Down Expand Up @@ -422,11 +423,14 @@ public function getDomSitemap(AbstractContainer $container = null)

// validate using schema if specified
if ($this->getUseSchemaValidation()) {
if (!@$dom->schemaValidate(self::SITEMAP_XSD)) {
ErrorHandler::start();
$test = $dom->schemaValidate(self::SITEMAP_XSD);
$error = ErrorHandler::stop();
if (!$test) {
throw new Exception\RuntimeException(sprintf(
'Sitemap is invalid according to XML Schema at "%s"',
self::SITEMAP_XSD
));
), 0, $error);
}
}

Expand Down

0 comments on commit 0a6bf6e

Please sign in to comment.