What steps will reproduce the problem?
1. Attempt to create whichever template using the createTemplate(template,
data) version (as described in the api for that function) using empty array as
the data parameter.
What is the expected output? What do you see instead?
The function still outputs the template as it should, but it also produces to
error log:
PHP Notice: Array to string conversion in lib/smarty3/Smarty.class.php on line
1211
With some templates I've gotten an additional
PHP Notice: Array to string conversion in
lib/smarty3/sysplugins/smarty_internal_template.php on line 643
It is certainly connected since it only occurs with the empty array
construction, but I haven't singled out why some templates trigger it and some
don't.
What version of the product are you using? On what operating system?
@version 3.1-DEV
$Id: Smarty.class.php 4694 2013-01-13 21:13:14Z
on Ubuntu 13.10
Please provide any additional information below.
This seems to be related to the manner how the function implements checking if
the argument passed in as $cache_id is an array on line 1194. Because the
builtin empty() function returns true for empty arrays, the check to see if the
parameter is an array is omitted and the parameter is kept. This then causes
the error when its value later is concatenated to a string. Suggest to check
instead of empty() for !== null on both lines 1194 and 1198 to ensure intended
behavior also when getting an empty array.
Original issue reported on code.google.com by samuli.k...@gmail.com on 18 Apr 2014 at 7:45
Original issue reported on code.google.com by
samuli.k...@gmail.com
on 18 Apr 2014 at 7:45