Commit 99607148 authored by mmn's avatar mmn

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:?
parent 90045d66
......@@ -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]?)'
: '').
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment