Add validation to prevent empty template_class_prefix.

Fixes #298
This commit is contained in:
Justin Hileman
2017-07-03 00:24:50 -07:00
parent 933554098a
commit 55e6ac81ba
2 changed files with 14 additions and 0 deletions
+4
View File
@@ -142,6 +142,10 @@ class Mustache_Engine
public function __construct(array $options = array())
{
if (isset($options['template_class_prefix'])) {
if ((string) $options['template_class_prefix'] === '') {
throw new Mustache_Exception_InvalidArgumentException('Mustache Constructor "template_class_prefix" must not be empty');
}
$this->templateClassPrefix = $options['template_class_prefix'];
}