Re: [SMARTY] Smarty Config Error
| From: | Paul Lockaby | Date: | Sat, 22 Feb 2003 19:39:31 +0000 |
| Subject: | Re: [SMARTY] Smarty Config Error | ||
| References: | 1 | Groups: | php.smarty.dev php.smarty.general |
| Request: | Send a blank email to php-smarty-dev+get-822@lists.php.net to get a copy of this message | ||
Paul Lockaby wrote:
> Hi,
>
> This will fail:
>
> {config_load file="config/#p_DefaultLanguage#.lang"}
>
> However, this does not:
>
> {config_load file="config/$p_DefaultLanguage.lang"}
>
> Can we get it so that they both work?
>
Hi,
I solved this problem and I would like to submit the following change
for inclusion into Smarty. I made this change using the most recent CVS
version of Smarty_Compiler.class.php (version 1.180). All there is to it
is this.
In the function _expand_quoted_text, I added the following elseif:
} elseif
(preg_match_all('%(?<!\\\\)\#(?:smarty(?:\.\w+)+|\w+(?:'.$this->_var_bracket_regexp.')*)\#%',$var_expr,$match))
{
// config variables
rsort($match[0]);
reset($match[0]);
foreach($match[0] as $var) {
$var_expr =
str_replace($var,'".'.$this->_parse_conf_var($var).'."',$var_expr);
}
return preg_replace('!\.""|""\.!', '', $var_expr);
I have attached a file called "patch.txt" that shows the entire file. I
would make a normal "patch" file, but I really don't know how. So there
ya go. I hope this fixes a problem that's been plaguing me since I've
started using Smarty.
~Paul