diff options
Diffstat (limited to 'inc/poche/Tools.class.php')
-rw-r--r-- | inc/poche/Tools.class.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 834940ff..7bc8830a 100644 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php | |||
@@ -210,4 +210,15 @@ class Tools | |||
210 | { | 210 | { |
211 | return ((isset ($_REQUEST["$var"])) ? htmlentities($_REQUEST["$var"]) : $default); | 211 | return ((isset ($_REQUEST["$var"])) ? htmlentities($_REQUEST["$var"]) : $default); |
212 | } | 212 | } |
213 | |||
214 | public static function getDomain($url) | ||
215 | { | ||
216 | $pieces = parse_url($url); | ||
217 | $domain = isset($pieces['host']) ? $pieces['host'] : ''; | ||
218 | if (preg_match('/(?P<domain>[a-z0-9][a-z0-9\-]{1,63}\.[a-z\.]{2,6})$/i', $domain, $regs)) { | ||
219 | return $regs['domain']; | ||
220 | } | ||
221 | |||
222 | return FALSE; | ||
223 | } | ||
213 | } \ No newline at end of file | 224 | } \ No newline at end of file |