frontend, localization, bugfix
This commit is contained in:
@@ -160,6 +160,9 @@ class Parameter {
|
||||
if ($value instanceof DateTime) {
|
||||
$this->value = $value;
|
||||
$valid = true;
|
||||
} else if (is_int($value) || (is_string($value) && preg_match("/^\d+$/", $value))) {
|
||||
$this->value = (new \DateTime())->setTimestamp(intval($value));
|
||||
$valid = true;
|
||||
} else {
|
||||
$format = $this->getFormat();
|
||||
$d = DateTime::createFromFormat($format, $value);
|
||||
|
||||
@@ -13,11 +13,15 @@ class StringType extends Parameter {
|
||||
}
|
||||
|
||||
public function parseParam($value): bool {
|
||||
if(!is_string($value)) {
|
||||
if (!parent::parseParam($value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if($this->maxLength > 0 && strlen($value) > $this->maxLength) {
|
||||
if (!is_string($value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->maxLength > 0 && strlen($value) > $this->maxLength) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user