flyclothing Posted October 2, 2013 Share Posted October 2, 2013 We are trying to save products and categories and our store is now not working. I think It has to do with another section of script we had to correct. We are getting the following error when trying to save (update) products or categories: Warning: preg_match() [function.preg-match]: Compilation failed: invalid UTF-8 string at offset 19 in .../public_html/classes/Validate.php on line 155 This is the code from that section: return preg_match(Tools::cleanNonUnicodeSupport('/^[^0-9!<>,;?=+()@#"°{}_$%:]*$/u'), stripslashes($name)); This error is also showing: Property Logger->object_type is not valid Link to comment Share on other sites More sharing options...
vekia Posted October 3, 2013 Share Posted October 3, 2013 hello your issue is related to function: public static function isName($name){ return preg_match(Tools::cleanNonUnicodeSupport('/^[^0-9!<>,;?=+()@#"°{}_$%:]*$/u'), stripslashes($name)); } it's not related to isCleanHTML function. can you for test purposes instead of return preg_match(Tools::cleanNonUnicodeSupport('/^[^0-9!<>,;?=+()@#"°{}_$%:]*$/u'), stripslashes($name)); use just return stripslashes($name); Link to comment Share on other sites More sharing options...
flyclothing Posted October 3, 2013 Author Share Posted October 3, 2013 That seemed to solve the issue. Thank you. Should I worry about this when the next update is done since my code will be replaced? Link to comment Share on other sites More sharing options...
vekia Posted October 3, 2013 Share Posted October 3, 2013 it's weirdy that you've got issues like this. maybe you used some specific characters in the name field etc? Should I worry about this when the next update is done since my code will be replaced? yes, it will be replaced unfortunately in this case you will have to prepare some overrides Link to comment Share on other sites More sharing options...
flyclothing Posted October 3, 2013 Author Share Posted October 3, 2013 Yeah, we used the "&" symbol, which you provided a solution for on our imports. I didnt see that symbol listed in the code though but I briefly glanced over it. Link to comment Share on other sites More sharing options...
vekia Posted October 3, 2013 Share Posted October 3, 2013 thank you for info, anyway, glad that it works for you well now im going to mark this thread as [solved] with regards, Milos Link to comment Share on other sites More sharing options...
mefamdd Posted August 1, 2016 Share Posted August 1, 2016 Hello dear, i used prestashop 1.6.1.5 i will change, code in prestashop\classes\Validate.php comment out this code/*if (preg_match('/<[\s]*script/ims', $html) || preg_match('/('.$events.')[\s]*=/ims', $html) || preg_match('/.*script\:/ims', $html))return false;if (!$allow_iframe && preg_match('/<[\s]*(i?frame|form|input|embed|object)/ims', $html))return false;*/ because i need Insert iframe on cms but now my website no open, anyone can help me, Thank you. Link to comment Share on other sites More sharing options...
dongthoigian206 Posted October 26, 2016 Share Posted October 26, 2016 You can check again name class: Ex: class name_class_model extends ObjectModel {} Use just: class nameclassmodel extends ObjectModel {} Note: Don't use "_" in name class Link to comment Share on other sites More sharing options...
Recommended Posts