This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 4

Mach4 Error – This field is not in the correct website address format.


  1. Igorb
    Member

    Hi there, I have upgraded our installation to v4 a couple of days back. Now I get a "This field is not in the correct website address format." error message that when someone tries submitting a URL in the following format "http://www.yoursute.com/something". Format "http://www.yoursute.com/" is fine. I thought this glitch was fixed ages ago... What's up?

    Posted 10 years ago #
  2. yuniar

    Sorry for this! This bug seems to be reappear when we fixed another one.

    To fix this, you can edit your "includes/common-validator.php" file. Search around line 364 for this code:

    $value[0] = trim($value[0],'/');
    
    if(!empty($value[0])){
    $regex  = '/^https?:\/\/([a-z0-9]([-a-z0-9]*[a-z0-9])?\.)+[A-z0-9]{2,}$/i';

    change the first and the last line of the above code, to be like this:

    $value[0] = trim($value[0],'/').'/';
    
    if(!empty($value[0])){
    $regex  = '/^https?:\/\/([a-z0-9]([-a-z0-9]*[a-z0-9])?\.)+([A-z0-9]{2,})(\/)(.*)$/i';

    MachForm Founder

    Posted 10 years ago #
  3. Igorb
    Member

    Thanks yuniar – problem solved! Cheers :)

    Posted 10 years ago #

RSS feed for this topic

Reply