allow more complex access-log formats to be displayed correctly on the UI, fixes #1139
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -181,7 +181,8 @@ return [
|
||||
'label' => lng('serversettings.logfiles_format'),
|
||||
'settinggroup' => 'system',
|
||||
'varname' => 'logfiles_format',
|
||||
'type' => 'text',
|
||||
'type' => (strpos(Settings::Get('system.logfiles_format'), '"') !== false ? 'textarea' : 'text'),
|
||||
'string_regexp' => '/^[^\0\r\n<>]*$/i',
|
||||
'default' => '',
|
||||
'string_emptyallowed' => true,
|
||||
'save_method' => 'storeSettingField',
|
||||
|
||||
@@ -232,7 +232,7 @@ class Form
|
||||
if (((isset($fielddetails['visible']) && $fielddetails['visible']) || !isset($fielddetails['visible'])) && (!$only_enabledisable || ($only_enabledisable && isset($fielddetails['overview_option'])))) {
|
||||
$newfieldvalue = self::getFormFieldData($fieldname, $fielddetails, $input);
|
||||
if ($newfieldvalue != $fielddetails['value']) {
|
||||
if (($error = \Froxlor\Validate\Form::validateFormField($fieldname, $fielddetails, $newfieldvalue)) != true) {
|
||||
if (($error = \Froxlor\Validate\Form::validateFormField($fieldname, $fielddetails, $newfieldvalue)) !== true) {
|
||||
Response::standardError($error, $fieldname);
|
||||
} else {
|
||||
$changed_fields[$fieldname] = $newfieldvalue;
|
||||
|
||||
@@ -319,7 +319,11 @@ class Data
|
||||
{
|
||||
$returnvalue = 'stringformaterror';
|
||||
|
||||
if (preg_match('/^[^\0]*$/', $newfieldvalue)) {
|
||||
if (isset($fielddata['string_regexp']) && $fielddata['string_regexp'] != '') {
|
||||
if (preg_match($fielddata['string_regexp'], $newfieldvalue)) {
|
||||
$returnvalue = true;
|
||||
}
|
||||
} else if (preg_match('/^[^\0]*$/', $newfieldvalue)) {
|
||||
$returnvalue = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user