AnrDaemon

Results 238 comments of AnrDaemon
trafficstars

Note the change from regular to inline include at https://github.com/AnrDaemon/test-001/blob/smarty-639/testcase.php#L10-L11

Using `eval:` source, the code will work, but setting `$smarty->setForceCompile(true);` won't change the situation. Reordering include lines so that regular include is last will also work.

While this is a valid PHP construct, you have to keep in mind that Smarty is not a general purpose programming language. There's still ways to amend your issue, but...

Could you please fork https://github.com/AnrDaemon/test-001 and reproduce your issue in a branch cloned from the master?

You can use `{}` as RE delimiters, avoiding much of the "quote this, quote that" issue. But without a test case, all your code is for nothing.

Sorry, I did mean to say "quote this, don't quote that". `preg_match('{' . preg_quote($string) . '}u');` is perfectly safe.

> It's not for nothing for who does what I did: copy + fix the function and load it before Smarty loads. Without a clear test case you can't be...

I see the issue, however, the fix is not appropriate. The real problem is that 1. Smarty is changing `mb_internal_encoding`, consequently breaking entire environment; 2. `mb_split` is using *two encodings,*...

I'm tinkering with the code as we speak. May be, just may be, I will have a fix. I already have a regression test case, so this should be covered.