From 1c2e9a22d3160997205764949244efba44ac7b4a Mon Sep 17 00:00:00 2001 From: Chris Czub Date: Fri, 13 Jan 2012 15:34:18 -0500 Subject: [PATCH] Use the _throwsExceptions(MustacheException::UNKNOWN_PRAGMA) config properly --- Mustache.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Mustache.php b/Mustache.php index d0ff274..d09db96 100644 --- a/Mustache.php +++ b/Mustache.php @@ -403,7 +403,10 @@ class Mustache { $options_string = $matches['options_string']; if (!in_array($pragma_name, $this->_pragmasImplemented)) { - throw new MustacheException('Unknown pragma: ' . $pragma_name, MustacheException::UNKNOWN_PRAGMA); + if($this->_throwsException(MustacheException::UNKNOWN_PRAGMA)) + throw new MustacheException('Unknown pragma: ' . $pragma_name, MustacheException::UNKNOWN_PRAGMA); + else + return ''; } $options = array(); @@ -448,7 +451,10 @@ class Mustache { */ protected function _getPragmaOptions($pragma_name) { if (!$this->_hasPragma($pragma_name)) { - throw new MustacheException('Unknown pragma: ' . $pragma_name, MustacheException::UNKNOWN_PRAGMA); + if($this->_throwsException(MustacheException::UNKNOWN_PRAGMA)) + throw new MustacheException('Unknown pragma: ' . $pragma_name, MustacheException::UNKNOWN_PRAGMA); + else + return array(); } return (is_array($this->_localPragmas[$pragma_name])) ? $this->_localPragmas[$pragma_name] : array();