Skip to content

sfValidatorDate throws sfValidatorError with array as $value and therefore not usable in the message #317

Open
@flohoss

Description

@flohoss

When using the Date Validator and providing a Date 2024-11-31 (only 30 Days in November), the Validator correctly throws a sfValidatorError but with the value as array. This happens multiple times in that file...

The exact position it happend is inside the convertDateArrayToString function where the value is an array but not yet converted to a string.

// convert array to date string
if (is_array($value))
{
  $value = $this->convertDateArrayToString($value);
}

image

When trying to use %value% in the error message it won't be replaced, because getArguments of the class correctly checks for an array and returns nothing in the end. Therefore nothing of the error message will be replaced.

image

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions