mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Add is_URL()
This commit is contained in:
parent
772d312133
commit
5e9dd72acc
@ -1099,4 +1099,19 @@ function color($color = "0m") {
|
||||
}
|
||||
}
|
||||
|
||||
/****f* util/is_URL
|
||||
* NAME
|
||||
* is_URL
|
||||
* INPUTS
|
||||
* string to check
|
||||
* RESULT
|
||||
* Returns true if item is a URL
|
||||
******/
|
||||
function is_URL($url) {
|
||||
$match = preg_match("'\b(([\w-]+://?|www[.])[^\s()<>]+(?:\([\w\d]+\)|([^[:punct:]\s]|/)))'", $url);
|
||||
if($match)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
?>
|
||||
Loading…
Reference in New Issue
Block a user