mirror of
https://github.com/openvk/openvk
synced 2024-11-13 10:39:24 +03:00
improvement(bootstrap): small compat fixes for WIN_NT on PHP 8.1
This commit is contained in:
parent
c4fb793333
commit
939ea30262
3 changed files with 160 additions and 256 deletions
|
@ -200,7 +200,7 @@ function ovk_strftime_safe(string $format, ?int $timestamp = NULL): string
|
|||
{
|
||||
$sessionOffset = intval(Session::i()->get("_timezoneOffset"));
|
||||
$str = strftime($format, $timestamp + ($sessionOffset * MINUTE) * -1 ?? time() + ($sessionOffset * MINUTE) * -1, tr("__locale") !== '@__locale' ? tr("__locale") : NULL);
|
||||
if(PHP_SHLIB_SUFFIX === "dll") {
|
||||
if(PHP_SHLIB_SUFFIX === "dll" && version_compare(PHP_VERSION, "8.1.0", "<")) {
|
||||
$enc = tr("__WinEncoding");
|
||||
if($enc === "@__WinEncoding")
|
||||
$enc = "Windows-1251";
|
||||
|
@ -232,7 +232,7 @@ function ovk_is_ssl(): bool
|
|||
return $GLOBALS["requestIsSSL"];
|
||||
}
|
||||
|
||||
function parseAttachments(string $attachments)
|
||||
function parseAttachments(string $attachments): array
|
||||
{
|
||||
$attachmentsArr = explode(",", $attachments);
|
||||
$returnArr = [];
|
||||
|
@ -249,9 +249,10 @@ function parseAttachments(string $attachments)
|
|||
elseif(str_contains($attachment, "audio"))
|
||||
$attachmentType = "audio";
|
||||
|
||||
$attachmentIds = str_replace($attachmentType, "", $attachment);
|
||||
$attachmentOwner = (int)explode("_", $attachmentIds)[0];
|
||||
$attachmentId = (int)end(explode("_", $attachmentIds));
|
||||
$attachmentIds = str_replace($attachmentType, "", $attachment);
|
||||
$attachmentOwner = (int) explode("_", $attachmentIds)[0];
|
||||
$gatoExplotano = explode("_", $attachmentIds);
|
||||
$attachmentId = (int) end($gatoExplotano);
|
||||
|
||||
switch($attachmentType) {
|
||||
case "photo":
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
"require": {
|
||||
"php": "~7.3||~8.1",
|
||||
"guzzlehttp/guzzle": "^6.5",
|
||||
"komeiji-satori/curl": "dev-master",
|
||||
"whichbrowser/parser": "dev-master",
|
||||
"james-heinrich/getid3": "^1.9@dev",
|
||||
"rybakit/msgpack": "dev-master",
|
||||
|
@ -11,7 +10,7 @@
|
|||
"ezyang/htmlpurifier": "dev-master",
|
||||
"scssphp/scssphp": "dev-main",
|
||||
"lfkeitel/phptotp": "dev-master",
|
||||
"chillerlan/php-qrcode": "dev-main",
|
||||
"chillerlan/php-qrcode": "5.0.2",
|
||||
"vearutop/php-obscene-censor-rus": "dev-master",
|
||||
"erusev/parsedown": "dev-master",
|
||||
"bhaktaraz/php-rss-generator": "dev-master",
|
||||
|
@ -20,7 +19,8 @@
|
|||
"symfony/console": "5.4.x-dev",
|
||||
"wapmorgan/morphos": "dev-master",
|
||||
"ext-sodium": "*",
|
||||
"php81_bc/strftime": "^0.0.2"
|
||||
"php81_bc/strftime": "^0.0.2",
|
||||
"ext-iconv": "*"
|
||||
},
|
||||
"minimum-stability": "dev"
|
||||
"minimum-stability": "beta"
|
||||
}
|
||||
|
|
397
composer.lock
generated
397
composer.lock
generated
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue