mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-03 09:54:27 +02:00
Smarty no longer calls mb_internal_encoding()
and doesn't check for deprecated mbstring.func_overload
ini directive.
Fixes #480.
This commit is contained in:
@@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Lexers and Parsers PHP files are no longer under version control, but generated from sources (.y and .plex)
|
||||
- Smarty now always runs in multibyte mode, using `symfony/polyfill-mbstring` if required. Please use the
|
||||
multibyte extension for optimal performance.
|
||||
- Smarty no longer calls `mb_internal_encoding()` and doesn't check for deprecated `mbstring.func_overload` ini directive [#480](https://github.com/smarty-php/smarty/issues/480)
|
||||
|
||||
### Deprecated
|
||||
- `$smarty->getPluginsDir()`
|
||||
|
@@ -106,15 +106,6 @@ class Configfile extends BaseCompiler {
|
||||
);
|
||||
/* @var ConfigfileParser $this->parser */
|
||||
$this->parser = new ConfigfileParser($this->lex, $this);
|
||||
if (function_exists('mb_internal_encoding')
|
||||
&& function_exists('ini_get')
|
||||
&& ((int)ini_get('mbstring.func_overload')) & 2
|
||||
) {
|
||||
$mbEncoding = mb_internal_encoding();
|
||||
mb_internal_encoding('ASCII');
|
||||
} else {
|
||||
$mbEncoding = null;
|
||||
}
|
||||
if ($this->smarty->_parserdebug) {
|
||||
$this->parser->PrintTrace();
|
||||
}
|
||||
@@ -127,9 +118,6 @@ class Configfile extends BaseCompiler {
|
||||
}
|
||||
// finish parsing process
|
||||
$this->parser->doParse(0, 0);
|
||||
if ($mbEncoding) {
|
||||
mb_internal_encoding($mbEncoding);
|
||||
}
|
||||
if ($this->smarty->debugging) {
|
||||
$this->smarty->getDebug()->end_compile($this->template);
|
||||
}
|
||||
|
@@ -1254,15 +1254,6 @@ class Template extends BaseCompiler {
|
||||
if ($isTemplateSource && $this->template->caching) {
|
||||
$this->parser->insertPhpCode("<?php\n\$_smarty_tpl->getCompiled()->nocache_hash = '{$this->nocache_hash}';\n?>\n");
|
||||
}
|
||||
if (function_exists('mb_internal_encoding')
|
||||
&& function_exists('ini_get')
|
||||
&& ((int)ini_get('mbstring.func_overload')) & 2
|
||||
) {
|
||||
$mbEncoding = mb_internal_encoding();
|
||||
mb_internal_encoding('ASCII');
|
||||
} else {
|
||||
$mbEncoding = null;
|
||||
}
|
||||
if ($this->smarty->_parserdebug) {
|
||||
$this->parser->PrintTrace();
|
||||
$this->parser->lex->PrintTrace();
|
||||
@@ -1277,9 +1268,6 @@ class Template extends BaseCompiler {
|
||||
}
|
||||
// finish parsing process
|
||||
$this->parser->doParse(0, 0);
|
||||
if ($mbEncoding) {
|
||||
mb_internal_encoding($mbEncoding);
|
||||
}
|
||||
// check for unclosed tags
|
||||
if ($this->getTagStackCount() > 0) {
|
||||
// get stacked info
|
||||
|
@@ -488,7 +488,7 @@ class DefaultExtension extends Base {
|
||||
* @link http://www.ibm.com/developerworks/library/os-php-unicode/index.html#listing3 for inspiration
|
||||
*
|
||||
* @param string $string characters to calculate unicode of
|
||||
* @param string $encoding encoding of $string, if null mb_internal_encoding() is used
|
||||
* @param string $encoding encoding of $string
|
||||
*
|
||||
* @return array sequence of unicodes
|
||||
* @author Rodney Rehm
|
||||
|
@@ -531,9 +531,6 @@ class Smarty extends \Smarty\TemplateBase
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
if (is_callable('mb_internal_encoding')) {
|
||||
mb_internal_encoding(\Smarty\Smarty::$_CHARSET);
|
||||
}
|
||||
$this->start_time = microtime(true);
|
||||
// Check if we're running on Windows
|
||||
\Smarty\Smarty::$_IS_WINDOWS = strtoupper(substr(PHP_OS, 0, 3)) === 'WIN';
|
||||
|
Reference in New Issue
Block a user