fix(links, away)

This commit is contained in:
veselcraft 2025-03-16 17:42:14 +03:00
parent c0efd19fcd
commit 8be6fae0dd
No known key found for this signature in database
GPG key ID: 9CF0B42766CCF7BA
2 changed files with 5 additions and 5 deletions

View file

@ -41,11 +41,11 @@ trait TRichText
return preg_replace_callback( return preg_replace_callback(
"%(([A-z]++):\/\/(\S*?\.\S*?))([\s)\[\]{},\"\'<]|\.\s|$)%", "%(([A-z]++):\/\/(\S*?\.\S*?))([\s)\[\]{},\"\'<]|\.\s|$)%",
(function (array $matches): string { (function (array $matches): string {
$href = str_replace("#", "&num;", $matches[1]); $href = rawurlencode($matches[1]);
$href = rawurlencode(str_replace(";", "&#59;", $href)); $href = str_replace("%26amp%3B", "%26", $href);
$link = str_replace("#", "&num;", $matches[3]); $link = $matches[3];
# this string breaks ampersands # this string breaks ampersands
$link = str_replace(";", "&#59;", $link); # $link = str_replace(";", "&#59;", $link);
$rel = $this->isAd() ? "sponsored" : "ugc"; $rel = $this->isAd() ? "sponsored" : "ugc";
/*$server_domain = str_replace(':' . $_SERVER['SERVER_PORT'], '', $_SERVER['HTTP_HOST']); /*$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("HTTP/1.0 302 Found");
header("X-Robots-Tag: noindex, nofollow, noarchive"); header("X-Robots-Tag: noindex, nofollow, noarchive");
header("Location: " . $this->queryParam("to")); header("Location: " . rawurldecode($this->queryParam("to")));
exit; exit;
} }