Compare commits

..

1 commit

Author SHA1 Message Date
ayato
3ebb85a8ea
Merge 14bcb8a271 into b92bf7f41a 2025-03-14 22:21:22 +05:00
4 changed files with 7 additions and 10 deletions

View file

@ -41,11 +41,11 @@ trait TRichText
return preg_replace_callback(
"%(([A-z]++):\/\/(\S*?\.\S*?))([\s)\[\]{},\"\'<]|\.\s|$)%",
(function (array $matches): string {
$href = rawurlencode($matches[1]);
$href = str_replace("%26amp%3B", "%26", $href);
$link = $matches[3];
$href = str_replace("#", "&num;", $matches[1]);
$href = rawurlencode(str_replace(";", "&#59;", $href));
$link = str_replace("#", "&num;", $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

@ -524,10 +524,7 @@ class User extends RowModel
public function getAge(): ?int
{
$birthday = new \DateTime();
$birthday->setTimestamp($this->getBirthday()->timestamp());
$today = new \DateTime();
return (int) $today->diff($birthday)->y;
return (int) floor((time() - $this->getBirthday()->timestamp()) / YEAR);
}
public function get2faSecret(): ?string

View file

@ -157,7 +157,7 @@ class Users
{
return (object) [
"all" => (clone $this->users)->count('*'),
"active" => (clone $this->users)->where("online >= ?", time() - MONTH)->count('*'),
"active" => (clone $this->users)->where("online > 0")->count('*'),
"online" => (clone $this->users)->where("online >= ?", time() - 900)->count('*'),
];
}

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: " . rawurldecode($this->queryParam("to")));
header("Location: " . $this->queryParam("to"));
exit;
}