From 0dd7ddb2d1ac1dcb9a459dcf29c803a7c2647fea Mon Sep 17 00:00:00 2001 From: "monte.ohrt" Date: Wed, 19 Oct 2011 14:32:52 +0000 Subject: [PATCH] add exception for using php4 style constructor --- libs/Smarty.class.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index fd9dc627..807d6706 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -665,6 +665,15 @@ class Smarty extends Smarty_Internal_TemplateBase { } } + + /** + * Throw error when using PHP 4 style constructor + */ + public function Smarty() + { + throw new SmartyException("PHP5 requires you to call __construct() instead of Smarty()"); + } + /** * Check if a template resource exists * @@ -1454,4 +1463,4 @@ function smartyAutoload($class) } } -?> \ No newline at end of file +?>