mirror of
https://github.com/openvk/openvk
synced 2025-04-23 08:33:02 +03:00
Compare commits
4 commits
473d84078a
...
4ea1c90eb7
Author | SHA1 | Date | |
---|---|---|---|
|
4ea1c90eb7 | ||
|
a12c77083b | ||
|
4815186b79 | ||
|
9ef7d2d7c4 |
4 changed files with 10 additions and 7 deletions
|
@ -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("#", "#", $matches[1]);
|
$href = rawurlencode($matches[1]);
|
||||||
$href = rawurlencode(str_replace(";", ";", $href));
|
$href = str_replace("%26amp%3B", "%26", $href);
|
||||||
$link = str_replace("#", "#", $matches[3]);
|
$link = $matches[3];
|
||||||
# this string breaks ampersands
|
# this string breaks ampersands
|
||||||
$link = str_replace(";", ";", $link);
|
# $link = str_replace(";", ";", $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']);
|
||||||
|
|
|
@ -524,7 +524,10 @@ class User extends RowModel
|
||||||
|
|
||||||
public function getAge(): ?int
|
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
|
public function get2faSecret(): ?string
|
||||||
|
|
|
@ -157,7 +157,7 @@ class Users
|
||||||
{
|
{
|
||||||
return (object) [
|
return (object) [
|
||||||
"all" => (clone $this->users)->count('*'),
|
"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('*'),
|
"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("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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue