php-Smarty: backport 3.1.13