Merge pull request #3705 from annando/diaspora-link-2

Improved regular expression for the Diaspora link detection
2022.09-rc
Tobias Diekershoff 2017-09-15 07:15:54 +02:00 zatwierdzone przez GitHub
commit ba5cbbe880
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -987,7 +987,8 @@ function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = fa
// Server independent link to posts and comments
// See issue: https://github.com/diaspora/diaspora_federation/issues/75
$Text = preg_replace("=diaspora://(.*?)/([^\s\]]*)=ism", System::baseUrl()."/display/$2", $Text);
$expression = "=diaspora://.*?/post/([0-9A-Za-z\-_@.:]{15,254}[0-9A-Za-z])=ism";
$Text = preg_replace($expression, System::baseUrl()."/display/$1", $Text);
// if the HTML is used to generate plain text, then don't do this search, but replace all URL of that kind to text
// if ($simplehtml != 7) {