-1

I have a module for joomla (tp_whois) I vote the following message when I consult the availability of a domain:

Warning: preg_match() [function.preg-match]: No ending delimiter '^' found in /home/carfaja/public_html/components/com_tpwhois/classes/domains.php on line 89

I look at the code in line 89:

// check format
    if (!preg_match("^[a-zA-Z0-9]+[a-zA-Z0-9-]*[a-zA-Z0-9]+$", $domain))
        $this->CORE->ERROR->stop("domain_badformat");

And can not find the error.

Please help me. Thanks

John Conde
  • 217,595
  • 99
  • 455
  • 496

1 Answers1

0

You're missing the delimiters for your regular expression

!preg_match("^[a-zA-Z0-9]+[a-zA-Z0-9-]*[a-zA-Z0-9]+$"

should be

!preg_match("~^[a-zA-Z0-9]+[a-zA-Z0-9-]*[a-zA-Z0-9]+$~"

or

!preg_match("/^[a-zA-Z0-9]+[a-zA-Z0-9-]*[a-zA-Z0-9]+$/"

or whatever delimeter you choose

John Conde
  • 217,595
  • 99
  • 455
  • 496