[phpmyadmin/phpmyadmin] 8fea06: Fix #18304 - Avoid TypeError when adding a column without index data
Branch: refs/heads/QA_5_2 Home: https://github.com/phpmyadmin/phpmyadmin Commit: 8fea06d16ba7149f80d569576173834e6311b351 https://github.com/phpmyadmin/phpmyadmin/commit/8fea06d16ba7149f80d569576173... Author: Towy <towy@airreps.link> Date: 2026-07-09 (Thu, 07 July 2026) +02:00 Changed paths: M libraries/classes/CreateAddField.php M test/classes/CreateAddFieldTest.php Log Message: ----------- Fix #18304 - Avoid TypeError when adding a column without index data CreateAddField::getIndexedColumns() passed the raw $_POST index values straight to json_decode(). When a column is added through a request that does not submit the primary_indexes, indexes, unique_indexes, fulltext_indexes and spatial_indexes fields (for example when adding a primary key column from the normalization page), those keys are undefined. Under strict_types this raised "json_decode(): Argument #1 ($json) must be of type string, null given" together with "Undefined array key" warnings, and the column was not added. Default each of these request values to an empty JSON array so that adding a column keeps working when no index information is provided. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Towy <towy@airreps.link> Commit: ddd5440ec32bea9beba5eba1e1f701ec09dcdcfe https://github.com/phpmyadmin/phpmyadmin/commit/ddd5440ec32bea9beba5eba1e1f7... Author: William Desportes <williamdes@wdes.fr> Date: 2026-07-11 (Sat, 07 July 2026) +02:00 Changed paths: M libraries/classes/CreateAddField.php M test/classes/CreateAddFieldTest.php Log Message: ----------- Merge #20367 - Fix #18304 - Avoid TypeError when adding a column without index data Pull-request: #20367 Fixes: #18304 Signed-off-by: William Desportes <williamdes@wdes.fr> Commit: 1a789d1c4d018509a0d4fa53f4100d938baaa51b https://github.com/phpmyadmin/phpmyadmin/commit/1a789d1c4d018509a0d4fa53f410... Author: William Desportes <williamdes@wdes.fr> Date: 2026-07-11 (Sat, 07 July 2026) +02:00 Changed paths: M psalm-baseline.xml Log Message: ----------- Update the psalm baseline
participants (1)
-
Towy