aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche/Tools.class.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-08-05 15:54:37 +0200
committerNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2013-08-05 15:54:37 +0200
commit55821e04c188997d258645975220828e195d0df4 (patch)
tree9a85831aa55c35c2fa69122220f7c873d73a9143 /inc/poche/Tools.class.php
parentb161295d0b53a5ae194e236b0a7c662e9ac2ff9a (diff)
downloadwallabag-55821e04c188997d258645975220828e195d0df4.tar.gz
wallabag-55821e04c188997d258645975220828e195d0df4.tar.zst
wallabag-55821e04c188997d258645975220828e195d0df4.zip
share email +twitter / class messages
Diffstat (limited to 'inc/poche/Tools.class.php')
-rw-r--r--inc/poche/Tools.class.php11
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