Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/Symfony/Component/Form/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,17 @@ public function submit($submittedData, $clearMissing = true)
$emptyData = $emptyData($this, $viewData);
}

// Treat false as NULL to support binding false to checkboxes.
// Don't convert NULL to a string here in order to determine later
// whether an empty value has been submitted or whether no value has
// been submitted at all. This is important for processing checkboxes
// and radio buttons with empty values.
if (false === $emptyData) {
$emptyData = null;
} elseif (is_scalar($emptyData)) {
$emptyData = (string) $emptyData;
}

$viewData = $emptyData;
}

Expand Down