From: Mikael Nordfeldth Date: Wed, 3 Feb 2016 14:26:19 +0000 (+0100) Subject: Disallow zero-length magnet URIs X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=996071489699923f85bb8dc0db9da726b4a16044;p=quix0rs-gnu-social.git Disallow zero-length magnet URIs magnet: would match, but now we have a zero-length lookahead which requires the following character to be a question mark: magnet:? --- diff --git a/lib/util.php b/lib/util.php index 6026105cb1..54296e1a4c 100644 --- a/lib/util.php +++ b/lib/util.php @@ -972,7 +972,7 @@ function common_replace_urls_callback($text, $callback, $arg = null) { ')'. ')'. // URLs without domain name, like magnet:?xt=... - '|(?:(?:' . implode('|', common_url_schemes(_URL_SCHEME_NO_DOMAIN)) . '):)'. + '|(?:(?:' . implode('|', common_url_schemes(_URL_SCHEME_NO_DOMAIN)) . '):(?=\?))'. // zero-length lookahead requires ? after : (common_config('linkify', 'bare_ipv4') // Convert IPv4 addresses to hyperlinks ? '|(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)' : '').