Bryce Posted June 15, 2013 Share Posted June 15, 2013 (edited) Anyone please help me I am new here and I dont know how to fix it Fatal error: Access to undeclared static property: Smarty::$_CHARSET in /home/thril921/public_html/tools/smarty/plugins/modifiercompiler.escape.php on line 35 what should I do? I dont know how to fix it http://thrillofasia.com.au/ modifier.capitalize.php Edited June 16, 2013 by Bryce (see edit history) Link to comment Share on other sites More sharing options...
PascalVG Posted June 16, 2013 Share Posted June 16, 2013 Hmm, $_CHARSET is defined in tools/smarty/Smarty.class.php: public static $_CHARSET = SMARTY_RESOURCE_CHAR_SET; Where SMARTY_RESOURCE_CHAR_SET is defined as: if (!defined('SMARTY_RESOURCE_CHAR_SET')) { // UTF-8 can only be done properly when mbstring is available! /** * @deprecated in favor of Smarty::$_CHARSET */ define('SMARTY_RESOURCE_CHAR_SET', SMARTY_MBSTRING ? 'UTF-8' : 'ISO-8859-1'); } Is this file tools/smarty/Smarty.class.php complete, available and readable (permissions OK?) My 2 cents, pascal Link to comment Share on other sites More sharing options...
Bryce Posted June 17, 2013 Author Share Posted June 17, 2013 Yes ok pascal, all this too hard for me to understand I should not have updated prestashop .PrestaShop™ 1.4.7.3 to higher Link to comment Share on other sites More sharing options...
Bryce Posted June 17, 2013 Author Share Posted June 17, 2013 yes ok pascal,please do Link to comment Share on other sites More sharing options...
silverbling Posted July 1, 2013 Share Posted July 1, 2013 (edited) Hello I have the same problem www.silverbling.ie. I have been having google analytics problems so I installed it through cpanel, I have now disabled the module I can find the file but am not sure what needs editing, can someone help please Fatal error: Access to undeclared static property: Smarty::$_CHARSET in /home3/s559027/public_html/tools/smarty/plugins/modifiercompiler.escape.php on line 35 line 35 inly has } nothing else <?php /** * Smarty plugin * * @package Smarty * @subpackage PluginsModifierCompiler */ /** * @ignore */ require_once( SMARTY_PLUGINS_DIR .'shared.literal_compiler_param.php' ); /** * Smarty escape modifier plugin * * Type: modifier<br> * Name: escape<br> * Purpose: escape string for output * * @link http://www.smarty.ne...modifier.escape count_characters (Smarty online manual) * @author Rodney Rehm * @param array $params parameters * @return string with compiled code */ function smarty_modifiercompiler_escape($params, $compiler) { try { $esc_type = smarty_literal_compiler_param($params, 1, 'html'); $char_set = smarty_literal_compiler_param($params, 2, Smarty::$_CHARSET); $double_encode = smarty_literal_compiler_param($params, 3, true); if (!$char_set) { $char_set = Smarty::$_CHARSET; } <<<<<<<<<<<<<<<<<.................................................................. line 35 switch ($esc_type) { case 'html': /* PrestaShop return 'htmlspecialchars(' . $params[0] .', ENT_QUOTES, ' . var_export($char_set, true) . ', ' . var_export($double_encode, true) . ')'; */ return 'htmlspecialchars(' . $params[0] .', ENT_QUOTES, ' . var_export($char_set, true) . ')'; /* END */ case 'htmlall': /* PrestaShop if (Smarty::$_MBSTRING) { return 'mb_convert_encoding(htmlspecialchars(' . $params[0] .', ENT_QUOTES, ' . var_export($char_set, true) . ', ' . var_export($double_encode, true) . '), "HTML-ENTITIES", ' . var_export($char_set, true) . ')'; } */ if (Smarty::$_MBSTRING) { return 'mb_convert_encoding(htmlspecialchars(' . $params[0] .', ENT_QUOTES, ' . var_export($char_set, true) . '), "HTML-ENTITIES", ' . var_export($char_set, true) . ')'; } /* END */ // no MBString fallback /* PrestaShop return 'htmlentities(' . $params[0] .', ENT_QUOTES, ' . var_export($char_set, true) . ', ' . var_export($double_encode, true) . ')'; */ return 'htmlentities(' . $params[0] .', ENT_QUOTES, ' . var_export($char_set, true) . ')'; /* END */ case 'url': return 'rawurlencode(' . $params[0] . ')'; case 'urlpathinfo': return 'str_replace("%2F", "/", rawurlencode(' . $params[0] . '))'; case 'quotes': // escape unescaped single quotes return 'preg_replace("%(?<!\\\\\\\\)\'%", "\\\'",' . $params[0] . ')'; case 'javascript': // escape quotes and backslashes, newlines, etc. return 'strtr(' . $params[0] . ', array("\\\\" => "\\\\\\\\", "\'" => "\\\\\'", "\"" => "\\\\\"", "\\r" => "\\\\r", "\\n" => "\\\n", "</" => "<\/" ))'; } } catch(SmartyException $e) { // pass through to regular plugin fallback } // could not optimize |escape call, so fallback to regular plugin if ($compiler->tag_nocache | $compiler->nocache) { $compiler->template->required_plugins['nocache']['escape']['modifier']['file'] = SMARTY_PLUGINS_DIR .'modifier.escape.php'; $compiler->template->required_plugins['nocache']['escape']['modifier']['function'] = 'smarty_modifier_escape'; } else { $compiler->template->required_plugins['compiled']['escape']['modifier']['file'] = SMARTY_PLUGINS_DIR .'modifier.escape.php'; $compiler->template->required_plugins['compiled']['escape']['modifier']['function'] = 'smarty_modifier_escape'; } return 'smarty_modifier_escape(' . join( ', ', $params ) . ')'; } ?> Edited July 1, 2013 by silverbling (see edit history) Link to comment Share on other sites More sharing options...
StoreCommander Posted July 8, 2013 Share Posted July 8, 2013 Hi, To fix it, I replaced: Smarty::$_CHARSET by 'UTF-8' everywhere in modifiercompiler.escape.php Good luck! Link to comment Share on other sites More sharing options...
Recommended Posts