Template/Endpoints (Prep)

* modernize DB-Types
   - long term: should be split in class that describes the DB-Type and container class that handles multiples
 * make unchanging filter props static, allow lookup of criteria indizes through filter
 * move username/mail/password checks to util and make them usable as input filter
This commit is contained in:
Sarjuuk
2025-08-06 20:47:20 +02:00
parent 8cf0b6243d
commit aeb84327d6
47 changed files with 1163 additions and 1082 deletions

View File

@@ -70,7 +70,7 @@ class Lang
self::$$k = $v;
// *cough* .. reuse-hacks (because copy-pastaing text for 5 locales sucks)
self::$item['cat'][2] = [self::$item['cat'][2], self::$spell['weaponSubClass']];
self::$item['cat'][2][1] = self::$spell['weaponSubClass'];
self::$item['cat'][2][1][14] .= ' ('.self::$item['cat'][2][0].')';
self::$main['moreTitles']['privilege'] = self::$privileges['_privileges'];
@@ -434,7 +434,7 @@ class Lang
return implode(', ', $tmp);
}
public static function getClassString(int $classMask, array &$ids = [], int $fmt = self::FMT_HTML) : string
public static function getClassString(int $classMask, ?array &$ids = [], int $fmt = self::FMT_HTML) : string
{
$classMask &= ChrClass::MASK_ALL; // clamp to available classes..
@@ -451,14 +451,14 @@ class Lang
$tmp = [];
foreach (ChrClass::fromMask($classMask) as $c)
$tmp[$c] = (!fMod(count($tmp) + 1, 3) ? $br : null).sprintf($base, $c, self::game('cl', $c));
$tmp[$c] = (!fMod(count($tmp) + 1, 3) ? $br : '').sprintf($base, $c, self::game('cl', $c));
$ids = array_keys($tmp);
return implode(', ', $tmp);
}
public static function getRaceString(int $raceMask, array &$ids = [], int $fmt = self::FMT_HTML) : string
public static function getRaceString(int $raceMask, ?array &$ids = [], int $fmt = self::FMT_HTML) : string
{
$raceMask &= ChrRace::MASK_ALL; // clamp to available races..
@@ -603,8 +603,11 @@ class Lang
Will choose a form based on the number preceding it. More than two forms (separated by colons) may be required by locale 8 (ruRU).
**/
public static function unescapeUISequences(string $var, int $fmt = -1) : string
public static function unescapeUISequences(?string $var, int $fmt = -1) : string
{
if (!$var)
return '';
if (strpos($var, '|') === false)
return $var;