Config/Locales

* flag locales as 'required'
 * allow bitmasks to be empty unless required
 * skip empty check in javascript
This commit is contained in:
Sarjuuk
2024-07-08 17:14:45 +02:00
parent 37def70f6a
commit 98b1771850
4 changed files with 4 additions and 9 deletions

View File

@@ -342,7 +342,7 @@ class Cfg
foreach (explode(', ', $info) as $option)
$mask |= (1 << explode(':', $option)[0]);
if (!($value &= $mask))
if (!($value &= $mask) && ($flags & self::FLAG_REQUIRED))
return 'value not in range';
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
UPDATE `aowow_config` SET `flags` = 1441 WHERE `key` = 'locales';

View File

@@ -193,12 +193,6 @@
value = value.toString().trim();
if (!value.length && (node.tagName != 'INPUT' || node.type != 'text'))
{
$WH.ae(_status, createStatusIcon('value is empty'));
return;
}
$(_status).append(CreateAjaxLoader());
new Ajax('?admin=siteconfig&action=update&key=' + id + '&val=' + escape(value), {