mirror of
https://github.com/openvk/openvk
synced 2025-04-23 00:23:01 +03:00
Compare commits
4 commits
8485a26b21
...
350f7b1a66
Author | SHA1 | Date | |
---|---|---|---|
|
350f7b1a66 | ||
|
a12c77083b | ||
|
4815186b79 | ||
|
9ef7d2d7c4 |
4 changed files with 10 additions and 7 deletions
|
@ -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']);
|
||||
|
|
|
@ -524,7 +524,10 @@ class User extends RowModel
|
|||
|
||||
public function getAge(): ?int
|
||||
{
|
||||
return (int) floor((time() - $this->getBirthday()->timestamp()) / YEAR);
|
||||
$birthday = new \DateTime();
|
||||
$birthday->setTimestamp($this->getBirthday()->timestamp());
|
||||
$today = new \DateTime();
|
||||
return (int) $today->diff($birthday)->y;
|
||||
}
|
||||
|
||||
public function get2faSecret(): ?string
|
||||
|
|
|
@ -157,7 +157,7 @@ class Users
|
|||
{
|
||||
return (object) [
|
||||
"all" => (clone $this->users)->count('*'),
|
||||
"active" => (clone $this->users)->where("online > 0")->count('*'),
|
||||
"active" => (clone $this->users)->where("online >= ?", time() - MONTH)->count('*'),
|
||||
"online" => (clone $this->users)->where("online >= ?", time() - 900)->count('*'),
|
||||
];
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue