1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 15:47:00 +02:00

Link URLs in select

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@1163 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana
2009-10-02 14:25:18 +00:00
parent 06984091d5
commit bc78866a8b
3 changed files with 14 additions and 1 deletions

View File

@@ -501,6 +501,15 @@ function is_email($email) {
return eregi("^$atom+(\\.$atom+)*@($domain?\\.)+$domain\$", $email);
}
/** Check whether the string is URL address
* @param string
* @return bool
*/
function is_url($string) {
$domain = '[a-z0-9]([-a-z0-9]{0,61}[a-z0-9])'; // one domain component
return preg_match("~^https?://($domain?\\.)+$domain(:[0-9]+)?(/.*)?(\\?.*)?(#.*)?\$~i", $string); //! restrict path, query and fragment characters
}
/** Print header for hidden fieldset (close by </div></fieldset>)
* @param string
* @param string