Clean blog Warning: Parameter 2 to timeAgoInWords() expected to be a reference
Posted: Sat Aug 25, 2018 2:38 am
PHP is : 5.6.36-0+deb8u1
Serendipity Version 2.2.0-beta2
I've found a bug in the Clean-Blog template. When I click on 'preview' to preview a blog or comments I get this error:
Fatal error: Uncaught exception 'ErrorException' with message 'Warning: Parameter 2 to timeAgoInWords() expected to be a reference, value given' in /home/admin/web/mysite.tld/public_html/blog/templates_c/clean_blog/5d/24/34/5d2434559a2ba1c20fd8ba09cc03d18d799fdd6f_0.file.comments.tpl.php:91 Stack trace: #0 [internal function]: errorToExceptionHandler(2, 'Parameter 2 to ...', '/home/admin/web...', 91, Array) #1 /home/admin/web/mysite.tld/public_html/blog/templates_c/clean_blog/5d/24/34/5d2434559a2ba1c20fd8ba09cc03d18d799fdd6f_0.file.comments.tpl.php(91): call_user_func_array('timeAgoInWords', Array) #2 /home/admin/web/mysite.tld/public_html/blog/bundled-libs/Smarty/libs/sysplugins/smarty_template_resource_base.php(126): content_5b80a136768448_15781237(Object(Smarty_Internal_Template)) #3 /home/admin/web/mysite.tld/public_html/blog/bundled-libs/Smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template)) #4 /hom in /home/admin/web/mysite.tld/public_html/blog/templates_c/clean_blog/5d/24/34/5d2434559a2ba1c20fd8ba09cc03d18d799fdd6f_0.file.comments.tpl.php on line 91
== ERROR-REPORT (BETA/ALPHA-BUILDS) ==
The solution is to edit 'templates/clean-blog/config.inc.php' and change the line:
function timeAgoInWords($params, &$smarty) {
to
function timeAgoInWords($params, $smarty) {
Any PHP version over 5.3 (I believe) does not allow this sort of reference. Strangely there are other references with the &$ and they don't seem to bother the app.
Hope this helps some other people. I'm not a PHP programmer so I kinda stumbled on this. It might not be the most elegant solution but it works well for me.
Roger
Serendipity Version 2.2.0-beta2
I've found a bug in the Clean-Blog template. When I click on 'preview' to preview a blog or comments I get this error:
Fatal error: Uncaught exception 'ErrorException' with message 'Warning: Parameter 2 to timeAgoInWords() expected to be a reference, value given' in /home/admin/web/mysite.tld/public_html/blog/templates_c/clean_blog/5d/24/34/5d2434559a2ba1c20fd8ba09cc03d18d799fdd6f_0.file.comments.tpl.php:91 Stack trace: #0 [internal function]: errorToExceptionHandler(2, 'Parameter 2 to ...', '/home/admin/web...', 91, Array) #1 /home/admin/web/mysite.tld/public_html/blog/templates_c/clean_blog/5d/24/34/5d2434559a2ba1c20fd8ba09cc03d18d799fdd6f_0.file.comments.tpl.php(91): call_user_func_array('timeAgoInWords', Array) #2 /home/admin/web/mysite.tld/public_html/blog/bundled-libs/Smarty/libs/sysplugins/smarty_template_resource_base.php(126): content_5b80a136768448_15781237(Object(Smarty_Internal_Template)) #3 /home/admin/web/mysite.tld/public_html/blog/bundled-libs/Smarty/libs/sysplugins/smarty_template_compiled.php(114): Smarty_Template_Resource_Base->getRenderedTemplateCode(Object(Smarty_Internal_Template)) #4 /hom in /home/admin/web/mysite.tld/public_html/blog/templates_c/clean_blog/5d/24/34/5d2434559a2ba1c20fd8ba09cc03d18d799fdd6f_0.file.comments.tpl.php on line 91
== ERROR-REPORT (BETA/ALPHA-BUILDS) ==
The solution is to edit 'templates/clean-blog/config.inc.php' and change the line:
function timeAgoInWords($params, &$smarty) {
to
function timeAgoInWords($params, $smarty) {
Any PHP version over 5.3 (I believe) does not allow this sort of reference. Strangely there are other references with the &$ and they don't seem to bother the app.
Hope this helps some other people. I'm not a PHP programmer so I kinda stumbled on this. It might not be the most elegant solution but it works well for me.
Roger