aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Nordfeldth <mmn@hethane.se>2017-04-22 10:51:03 +0200
committerMikael Nordfeldth <mmn@hethane.se>2017-04-22 11:23:41 +0200
commit64b72a3c9b8c9ee2d8716a3271834293d1e863f8 (patch)
treefe2db89f2c848989c7ecd7b0ea4e8313c7830449
parent3453521c9c235d8e99d959469aa5c08ca5d6e5fb (diff)
downloadgnu-social-64b72a3c9b8c9ee2d8716a3271834293d1e863f8.tar
gnu-social-64b72a3c9b8c9ee2d8716a3271834293d1e863f8.zip
New domain regexp for WebFinger matching.
-rw-r--r--plugins/OStatus/OStatusPlugin.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php
index eaf09bf6fd..09a25495df 100644
--- a/plugins/OStatus/OStatusPlugin.php
+++ b/plugins/OStatus/OStatusPlugin.php
@@ -287,7 +287,7 @@ class OStatusPlugin extends Plugin
$wmatches = array();
// Webfinger matches: @user@example.com or even @user--one.george_orwell@1984.biz
- if (preg_match_all('!(?:^|\s+)@((?:\w+[\w\-\_\.]?)*(?:[\w\-\_\.]*\w+)@(?:\w+\-?\w+\.)*\w+(?:\w+\-\w+)*\.\w+)!',
+ if (preg_match_all('/(?:^|\s+)@((?:\w+[\w\-\_\.]?)*(?:[\w\-\_\.]*\w+)@(?:(?!-)[A-Za-z0-9\-]{1,63}(?<!-)\.)+[A-Za-z]{2,10})/',
$text,
$wmatches,
PREG_OFFSET_CAPTURE)) {