|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
mb.ramsingh Smarty n00b
Joined: 08 Sep 2015 Posts: 1
|
Posted: Tue Sep 08, 2015 7:09 am Post subject: Weird bug in Smarty 3.1.12 |
|
|
Hi,
This is Ram. I have been using Smarty very actively in one of our internal site.
Heere are details:
Smarty 3.1.12
PHP 5.6.6
Nginx
Since recently we have been facing some wierd issue.
Every time We request a page smarty compiles its template and convert it into PHP(say x.php) code(writes in templates_c folder) and during compilation it creates an unique function name which is called inside the file(x.php).
Below is the code used in smarty class to generate unique function name
$compiler->smarty->merged_templates_func[$tpl_name]['func'] = $tpl->properties['unifunc'] = 'content_'.str_replace('.', '_', uniqid('', true));
file paths:
Smarty-3.1.12/libs/sysplugins/smarty_internal_template.php
Smarty-3.1.12/libs/sysplugins/smarty_internal_compile_include.php
But because of some setting issue sometimes the unique function name is containing some junk values.
Here I have copied the function with junk values:
<?php if ($_valid && !is_callable('content_0Û-V^L^?55484c8cf1cd80_24356251')) {function content_0Û-V^L^?55484c8cf1cd80_24356251($_smarty_tpl) {?>......';
?>
Where as the Correct compiled file content is
<?php if ($_valid && !is_callable('content_55484c8cf1cd80_24356251')) {function content_55484c8cf1cd80_24356251($_smarty_tpl) {?>......';
?>
And this is happening only some times.
I didn't know how to over come this so, I just cleared the templates_c. But even then it didn't resolve the issue, so I just restarted the PHP version and cleared again templates_c folder. This is happening frequently.
If anybody can look into it, it would be great help for us.
Thank you. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sat Sep 12, 2015 9:01 pm Post subject: |
|
|
What are your setting issues?
uniqueid should not return any junk values. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|