Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP mbstring extension required #14

Closed
orlitzky opened this issue Dec 31, 2014 · 4 comments
Closed

PHP mbstring extension required #14

orlitzky opened this issue Dec 31, 2014 · 4 comments

Comments

@orlitzky
Copy link

The composer.json file mentions only >=php-5.2, but the use of mb_convert_encoding in e.g. libs/plugins/modifier.escape.php requires the mbstring extension. This does actually cause a problem at runtime for me, and it goes away when PHP is recompiled.

@uwetews
Copy link
Contributor

uwetews commented Dec 31, 2014

Smarty does use mbstring functions when Smarty::$_MBSTRING is true.
It's value was determined by function_exists('mb_split') which was a bad idea as mb_split could be call able also when mbstring functions are not present but could be made available as overloaded version by php.ini mbstring.func_overload setting.

The fix has been commited 47faa63

@uwetews uwetews closed this as completed Dec 31, 2014
@orlitzky
Copy link
Author

orlitzky commented Jan 1, 2015

I accidentally commented on the commit 47faa63 yesterday rather than here; sorry. I have verified my suspicion using the following steps:

  1. Install smarty from git
  2. Install PHP with the mbstring extension
  3. Visit your site, on a page that uses escaping
  4. A cached template is stored in $smarty_dir/templates_c that makes use of mb_convert_encoding.
  5. Reinstall PHP, this time without mbstring
  6. Restart apache
  7. Visit the same page
  8. 500 error, missing mb_* functions.

@uwetews
Copy link
Contributor

uwetews commented Jan 1, 2015

Smarty does generate different compiled templates if PHP has mbstring extensions or not.
If you change your environvent like exchanging PHP you should delete the compiled and cached template files.

What you have done is not the normal use case.

I do not think that this is a shortcomming or bug of Smarty,

@orlitzky
Copy link
Author

orlitzky commented Jan 1, 2015

I wasn't suggesting that. I just wanted to point out for the search engines that the problem isn't what I initially reported.

Thanks again for your help!

think-mcunanan pushed a commit to think-mcunanan/smarty that referenced this issue Mar 22, 2023
…)-(BUG-FIX---kanzashiSalons-should-return-empty-collection)

Ticket #5021 (kirei) (bug fix - kanzashi salons should return empty collection)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants