You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
482 B
28 lines
482 B
<?php
|
|
/* For licensing terms, see /license.txt */
|
|
|
|
/**
|
|
* Abstract base class for QuickForm validation rules
|
|
*/
|
|
require_once 'HTML/QuickForm/Rule.php';
|
|
|
|
/**
|
|
* Validate urls
|
|
*
|
|
*/
|
|
class HTML_QuickForm_Rule_Url extends HTML_QuickForm_Rule
|
|
{
|
|
|
|
/**
|
|
* Validates url
|
|
*
|
|
* @param string $url
|
|
* @return boolean Returns true if valid, false otherwise.
|
|
*/
|
|
function validate($url)
|
|
{
|
|
return (bool) filter_var($url, FILTER_VALIDATE_URL);
|
|
}
|
|
|
|
}
|
|
|
|
|