Jump to content

Uploading files w/ Fetch FTP cause UTF-8 Warnings after installation??


Recommended Posts

I have successfully installed Prestashop multiple times on my server. Though continually I am faced with the following glitch:

Upon new account registration and submission I get the following error:


There are 3 errors :
1. lastname is invalid
2. firstname is invalid
3. city is invalid


And yes, these fields have been filled out correctly. Please see the page:

My registration form

Thank you.

Link to comment
Share on other sites

OK, well i found what's happening....

In Validate.php

    /**
   * Check for name validity
   *
   * @param string $name Name to validate
   * @return boolean Validity is ok or not
   */
   static public function isName($name)
   {
       return preg_match('/^[^0-9!<>,;?=+()@#"¨É{}_$%:]*$/u', stripslashes($name));
   }



The characters: ¨É are not UTF-8.

Link to comment
Share on other sites

This line in Validate.php, isName:

preg_match('/^[^0-9!<>,;?=+()@#"¨É{}_$%:]*$/u', stripslashes($name));



Causes this warning:

Warning: preg_match() [function.preg-match]: Compilation failed: invalid UTF-8 string at offset 19 in...

Anyone able to shed some light on why this errors would affect only some installations? Possibly php version?

Link to comment
Share on other sites

After an additional separate installation, on the same server, this time uploading the files with a different ftp tool, I had no errors.

My first attempts that continually displayed the errors above, all uploads were done with Fetch 4.0.3 FTP.

This last installation with no errors, I used FireFTP, the Firefox extention.

What would be happening with Fetch that would cause a "Warning: preg_match() [function.preg-match]: Compilation failed: invalid UTF-8 string at offset 19 in…" ????

Link to comment
Share on other sites

  • 10 months later...

I have encountered an number of the same issues (and spent many hours finding a solution). Your post was helpful in that it pointed me in the right direction. Though I also use Fetch I notice that there are several "Validate" regex that are choking.

static public function isName($name)
   {
       return preg_match('/^[^0-9!<>,;?=+()@#"°{}_$%:]*$/ui', stripslashes($name));
   }



..if changed to :

static public function isName($name)
   {
       return preg_match('/^[^0-9!<>,;?=+()@#{}_$%:]*$/ui', stripslashes($name));
   }



then works fine..

There are several others that have the ["°] combination and those need to be cleaned up as well.. I did find that tripping over this issue is specific to certain PHP configurations. I have yet to determine exactly what that configuration difference is..

Hope this helps someone else...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...