parse_data($input); } $smarty->display('eval:' . $input); ob_end_clean(); return true; } catch (Exception $e) { // error is always on line 1 in a string eval, so simplify the error message a little return preg_replace('/Syntax error in template .* on line \d+/', 'Syntax error in: ', $e->getMessage()); } }