PHP 8.4 fixes.

This commit is contained in:
flash 2024-07-31 03:24:54 +00:00
parent 325f5b5c86
commit a074aceddd
11 changed files with 10 additions and 4 deletions

View file

@ -1032,9 +1032,6 @@ if($reqPath === '/auth/register') {
}
if(!isset($authError)) {
if(!preg_match('#^([a-zA-Z0-9-_]{1,20})$#', $registerUsername)) {
}
try {
$createdUser = User::create(
$registerUsername,

View file

@ -9,6 +9,6 @@ class HtmlText implements HtmlTypeInterface {
}
public function asHTML(): string {
return htmlspecialchars($this->text);
return htmlspecialchars($this->text, ENT_COMPAT | ENT_SUBSTITUTE | ENT_HTML5);
}
}

View file

@ -6,6 +6,7 @@ use Exception;
class UploadNotFoundException extends Exception {};
class UploadCreationFailedException extends Exception {};
#[\AllowDynamicProperties]
final class Upload {
private const ID_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_';

View file

@ -9,6 +9,7 @@ class UserCreationInvalidNameException extends Exception {}
class UserCreationInvalidPasswordException extends Exception {}
class UserCreationInvalidMailException extends Exception {}
#[\AllowDynamicProperties]
class User {
public function __construct() {
}

View file

@ -6,6 +6,7 @@ use Exception;
class UserInviteNotFoundException extends Exception {}
class UserInviteCreationFailedException extends Exception {}
#[\AllowDynamicProperties]
final class UserInvite {
private const TOKEN_LENGTH = 16;

View file

@ -6,6 +6,7 @@ use Exception;
final class UserSessionNotFoundException extends Exception {};
final class UserSessionCreatedFailedException extends Exception {};
#[\AllowDynamicProperties]
class UserSession {
private const TOKEN_CHARS = 'abcdefghijklmnopqrstuvwxyz-0123456789_ABCDEFGHIJKLMNOPQRSTUVWXYZ';
private static $instance = null;

View file

@ -9,6 +9,7 @@ class ZoneInvalidIdException extends Exception {};
class ZoneInvalidNameException extends Exception {};
class ZoneInvalidTitleException extends Exception {};
#[\AllowDynamicProperties]
final class Zone {
private $effects = null;
private $passiveMode = false;

View file

@ -5,6 +5,7 @@ use Exception;
class ZoneEffectClassNotFoundException extends Exception {};
#[\AllowDynamicProperties]
final class ZoneEffect {
private const CLASS_NAME = '\\YTKNS\\Effects\\%sEffect';

View file

@ -1,6 +1,7 @@
<?php
namespace YTKNS;
#[\AllowDynamicProperties]
final class ZoneRedirect {
public function __construct() {
}

View file

@ -1,6 +1,7 @@
<?php
namespace YTKNS;
#[\AllowDynamicProperties]
final class ZoneTask {
public function getZoneId(): int {
return $this->zone_id ?? 0;

View file

@ -1,6 +1,7 @@
<?php
namespace YTKNS;
#[\AllowDynamicProperties]
final class ZoneView {
private const THRESHOLD = 60 * 60 * 24;