1
0
mirror of https://github.com/phpmyadmin/phpmyadmin.git synced 2026-10-25 06:39:48 +03:00
Files
phpmyadmin/libraries/classes/CreateAddField.php
Towy 8fea06d16b 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>
2026-07-09 18:34:22 +02:00

16 KiB