Column names containing [ cause problems

Issue #123 resolved
Christopher Kramer created an issue

Originally reported on Google Code with ID 123

Tested: Current version from SVN (Revision #239).

What steps will reproduce the problem?
1. Create a table using:

CREATE TABLE 'test " ä , 7' ('jgg " ü , 7 [ ''' INTEGER, 'mk8zbn oj' REAL default 'ä''
" ','!"§$%&/()=? }][{ -.,üöä?ß\~*^°&<>µ@€|<' INTEGER)

The [ is the interesting thing here, but this one caused another strange effect.

or simpler:

CREATE TABLE 'test ' ('a' INTEGER, '[' INTEGER )

2. Try to insert values

What is the expected output? What do you see instead?
Expected: Values inserted.
Instead (2nd example):

Notice: Undefined index: 0:[ in phpliteadmin.php on line 2125

Notice: Undefined index: function_0_[ in phpliteadmin.php on line 2130


Problem is that we use the column name for the form-field names and php replaces some
stuff here. Spaces are replaced with underscores _ and the same seems to be the case
for [ and ]. But the first example caused some strange POST-index containing spaces.

I'll need to look this up more closely. This bug report is so I won't forget this example.

Reported by crazy4chrissi on 2012-10-20 22:46:53

Comments (3)

  1. Christopher Kramer reporter
    Well, probably we should not use column-names as input-names at all. We should better
    enumerate the input-fields. To make sure the structure of the table did not change
    while we were entered data, we send the list of fields in another hidden input-field
    (we already do this anyway).
    
    This probably needs to be changed at several places. I'll go for it soon.
    

    Reported by crazy4chrissi on 2012-10-30 22:33:10

  2. phpLiteAdmin repo owner

    Fixed issue #123 (Column names containing [ cause problems). Now column-IDs are used as form-field-names instead of the column-names and thus no problems with column names containing [ or any other special character any longer

    → <<cset b31ea4c0816e>>

  3. Log in to comment