Remove http check for website field

Phoca Guestbook - creating guestbooks in Joomla! CMS
pastoweb
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 05 Sep 2010, 19:45

Remove http check for website field

Post by pastoweb »

Hi, I want to use the website field to store different information (country).
How can I remove the valididy check on the "http" presence on submit?
pastoweb
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 05 Sep 2010, 19:45

Re: Remove http check for website field

Post by pastoweb »

Ok, I did it :)
in case someone needs, just modify helpers/phocaguestbook.php adding a "return true;" in isURLAddress function:

function isURLAddress($url) {
return true;
return preg_match('|^http(s)?://[a-z0-9-]+(.[a-z0-9-]+)*(:[0-9]+)?(/.*)?$|i', $url);
}

This way, if you don't need users to enter a website address, you can use this field for any other information.
User avatar
Benno
Phoca Hero
Phoca Hero
Posts: 9704
Joined: 04 Dec 2008, 11:58
Location: Germany
Contact:

Re: Remove http check for website field

Post by Benno »

Ok.

Kind regards,
Benno
Post Reply