diff --git a/Web/Models/Entities/Traits/TRichText.php b/Web/Models/Entities/Traits/TRichText.php index f82626e2..17382dbc 100644 --- a/Web/Models/Entities/Traits/TRichText.php +++ b/Web/Models/Entities/Traits/TRichText.php @@ -41,11 +41,11 @@ trait TRichText return preg_replace_callback( "%(([A-z]++):\/\/(\S*?\.\S*?))([\s)\[\]{},\"\'<]|\.\s|$)%", (function (array $matches): string { - $href = str_replace("#", "#", $matches[1]); - $href = rawurlencode(str_replace(";", ";", $href)); - $link = str_replace("#", "#", $matches[3]); + $href = rawurlencode($matches[1]); + $href = str_replace("%26amp%3B", "%26", $href); + $link = $matches[3]; # this string breaks ampersands - $link = str_replace(";", ";", $link); + # $link = str_replace(";", ";", $link); $rel = $this->isAd() ? "sponsored" : "ugc"; /*$server_domain = str_replace(':' . $_SERVER['SERVER_PORT'], '', $_SERVER['HTTP_HOST']); diff --git a/Web/Presenters/AwayPresenter.php b/Web/Presenters/AwayPresenter.php index 59993935..2e236d0c 100644 --- a/Web/Presenters/AwayPresenter.php +++ b/Web/Presenters/AwayPresenter.php @@ -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; }