fix(links, away) (fixes #1253)

This commit is contained in:
Vladimir Barinov 2025-03-16 17:57:21 +03:00 committed by GitHub
parent 4815186b79
commit a12c77083b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View file

@ -41,11 +41,11 @@ trait TRichText
return preg_replace_callback(
"%(([A-z]++):\/\/(\S*?\.\S*?))([\s)\[\]{},\"\'<]|\.\s|$)%",
(function (array $matches): string {
$href = str_replace("#", "&num;", $matches[1]);
$href = rawurlencode(str_replace(";", "&#59;", $href));
$link = str_replace("#", "&num;", $matches[3]);
$href = rawurlencode($matches[1]);
$href = str_replace("%26amp%3B", "%26", $href);
$link = $matches[3];
# this string breaks ampersands
$link = str_replace(";", "&#59;", $link);
# $link = str_replace(";", "&#59;", $link);
$rel = $this->isAd() ? "sponsored" : "ugc";
/*$server_domain = str_replace(':' . $_SERVER['SERVER_PORT'], '', $_SERVER['HTTP_HOST']);

View file

@ -20,7 +20,7 @@ final class AwayPresenter extends OpenVKPresenter
header("HTTP/1.0 302 Found");
header("X-Robots-Tag: noindex, nofollow, noarchive");
header("Location: " . $this->queryParam("to"));
header("Location: " . rawurldecode($this->queryParam("to")));
exit;
}