Flourish PHP Unframework
This is an archived copy of the forum for reference purposes

FValidation addURLfields not throwing exception?

posted by anonymous 9 years ago

I have following code

try {
		$validator = new fValidation();
		$validator->addRequiredFields('site_name');
		$validator->addURLfields('site_name');
		$validator->validate();
} catch(fValidation $e) {
   echo $e->getMessage();
}

i pass urls like www.whatever without a .com and it passes.

anyone having similiar issue?

Right now fValidation and fORMColumn do validation to make sure URL/Link fields look like URLs. I don't really want to restrict the exact TLDs that are allowed since those will change over time. If you really want to make sure the domain exists, I would probably recommend trying get_headers() combined with fCore::startErrorCapture() to capture any errors that occur while grabbing the headers.

posted by wbond 9 years ago