Make WordPress Core

Ticket #10404: 10404_case_sensitivity_fix_CORRECT_4_1.diff

File 10404_case_sensitivity_fix_CORRECT_4_1.diff, 917 bytes (added by charlestonsw, 10 years ago)

Case insensitive KEY without syntax errors.

  • src/wp-admin/includes/upgrade.php

     
    17271727                        case 'unique':
    17281728                        case 'key':
    17291729                                $validfield = false;
    1730                                 $indices[] = trim(trim($fld), ", \n");
     1730                                $indices[] = strtoupper(trim(trim($fld), ", \n"));
    17311731                                break;
    17321732                        }
    17331733                        $fld = trim($fld);
     
    18251825                                }
    18261826                                // Add the column list to the index create string.
    18271827                                $index_string .= ' ('.$index_columns.')';
    1828                                 if (!(($aindex = array_search($index_string, $indices)) === false)) {
     1828                                if (!(($aindex = array_search(strtoupper($index_string), $indices)) === false)) {
    18291829                                        unset($indices[$aindex]);
    18301830                                        // todo: Remove this?
    18311831                                        //echo "<pre style=\"border:1px solid #ccc;margin-top:5px;\">{$table}:<br />Found index:".$index_string."</pre>\n";