Joined October 2015
·

Eloy Fernández

Pego
·
·

I also change the loop in the parse_variables for this other (sorry, I don´t find how "shortcode" the code):

foreach ($matches[0] as $match) {
$varname = strreplace('[', '', $match);
$varname = str
replace(']', '', $varname);
$langvalue = lang($varname); // get value from lang file
if ($lang
value)
$text = strreplace($match, $langvalue, $text);
}

A reason for this change is that if someone is using a javascripty array and make something like: myarray[0], or inside a loop like myarray[index], the original code would change [0] for 0 and [x] for x, and the result would be myarray0 and myarrayx and it throw an error.

Thanks for this solution.

Achievements
1 Karma
0 Total ProTip Views