Jump to content

[SOLVED] Validation Error Causing Data Not to Save


Recommended Posts

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: close.png Property Logger->object_type is not valid

Link to comment
Share on other sites

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

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

  • 2 years later...

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

  • 2 months later...
×
×
  • Create New...