Skip to content

Commit 9be9793

Browse files
adamzielclaude
andcommitted
Fix the zero-date CASE expression to compare the function call result, not the raw value
The strtr refactor accidentally changed `WHEN $function_call > '0'` to `WHEN {value} > '0'`, comparing the wrong operand and breaking date validation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 64cc464 commit 9be9793

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

wp-includes/sqlite-ast/class-wp-pdo-mysql-on-sqlite.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5694,7 +5694,7 @@ private function cast_value_for_saving(
56945694
WHEN {value} IS NULL THEN NULL
56955695
WHEN {value} IN ('0000-00-00', '0000-00-00 00:00:00') AND NOT {reject_zero_date} THEN {zero_date_value}
56965696
WHEN SUBSTR({value}, 1, 4) != '0000' AND (SUBSTR({value}, 6, 2) = '00' OR SUBSTR({value}, 9, 2) = '00') AND NOT {reject_zero_in_date} THEN {value}
5697-
WHEN {value} > '0' THEN {function_call}
5697+
WHEN {function_call} > '0' THEN {function_call}
56985698
ELSE {fallback}
56995699
END",
57005700
array(

0 commit comments

Comments
 (0)