Actualización
This commit is contained in:
23
main/inc/lib/formvalidator/Rule/Url.php
Normal file
23
main/inc/lib/formvalidator/Rule/Url.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Abstract base class for QuickForm validation rules.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Validate urls.
|
||||
*/
|
||||
class HTML_QuickForm_Rule_Url extends HTML_QuickForm_Rule
|
||||
{
|
||||
/**
|
||||
* Validates url.
|
||||
*
|
||||
* @param string $url
|
||||
*
|
||||
* @return bool returns true if valid, false otherwise
|
||||
*/
|
||||
public function validate($url, $options)
|
||||
{
|
||||
return (bool) filter_var($url, FILTER_VALIDATE_URL);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user