Ensured empty string is ignored as the domain during short URL creation

This commit is contained in:
Alejandro Celaya
2022-12-07 19:06:05 +01:00
parent 54bc169525
commit f41d947cf7
3 changed files with 30 additions and 1 deletions

View File

@@ -78,6 +78,12 @@ function getOptionalBoolFromInputFilter(InputFilter $inputFilter, string $fieldN
return $value !== null ? (bool) $value : null;
}
function getNonEmptyOptionalValueFromInputFilter(InputFilter $inputFilter, string $fieldName): mixed
{
$value = $inputFilter->getValue($fieldName);
return empty($value) ? null : $value;
}
function arrayToString(array $array, int $indentSize = 4): string
{
$indent = str_repeat(' ', $indentSize);