Make WordPress Core

Ticket #10404: 10404_make_key_case_insensitive_wp_4_1.diff

File 10404_make_key_case_insensitive_wp_4_1.diff, 1.4 KB (added by charlestonsw, 10 years ago)

4.1 patch candidate for case sensitivity fix

  • 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)) {
    1829                                         unset($indices[$aindex]);
    1830                                         // todo: Remove this?
    1831                                         //echo "<pre style=\"border:1px solid #ccc;margin-top:5px;\">{$table}:<br />Found index:".$index_string."</pre>\n";
    1832                                 }
     1828                if (!(($aindex = array_search(strtoupper($index_string), $indices)) === false)) {
     1829                        unset($indices[$aindex]);
     1830                        // todo: Remove this?
     1831                        //echo "<pre style=\"border:1px solid #ccc;margin-top:5px;\">{$table}:<br />Found index:".$index_string."</pre>\n";
     1832                    }
     1833                }
    18331834                                // todo: Remove this?
    18341835                                //else echo "<pre style=\"border:1px solid #ccc;margin-top:5px;\">{$table}:<br /><b>Did not find index:</b>".$index_string."<br />".print_r($indices, true)."</pre>\n";
    18351836                        }