Zeile 23 | Zeile 23 |
---|
{ $plugins->run_hooks("admin_tools_system_health_utf8_conversion");
|
{ $plugins->run_hooks("admin_tools_system_health_utf8_conversion");
|
if($db->type == "sqlite2" || $db->type == "sqlite3")
| if($db->type == "sqlite2" || $db->type == "sqlite3" || $db->type == "pgsql")
|
{ flash_message($lang->error_not_supported, 'error'); admin_redirect("index.php?module=tools/system_health");
| { flash_message($lang->error_not_supported, 'error'); admin_redirect("index.php?module=tools/system_health");
|
Zeile 96 | Zeile 96 |
---|
'varchar' => 'varbinary', 'tinytext' => 'tinyblob' );
|
'varchar' => 'varbinary', 'tinytext' => 'tinyblob' );
|
| $blob_types = array( 'blob', 'tinyblob', 'mediumblog', 'longblob', 'text', 'tinytext', 'mediumtext', 'longtext' );
|
// Get next table in list $convert_to_binary = '';
| // Get next table in list $convert_to_binary = '';
|
Zeile 115 | Zeile 117 |
---|
case "mysqli": preg_match_all("#FULLTEXT KEY `?([a-zA-Z0-9_]+)`? \(([a-zA-Z0-9_`,']+)\)#i", $table_structure, $matches); if(is_array($matches))
|
case "mysqli": preg_match_all("#FULLTEXT KEY `?([a-zA-Z0-9_]+)`? \(([a-zA-Z0-9_`,']+)\)#i", $table_structure, $matches); if(is_array($matches))
|
{
| {
|
foreach($matches[0] as $key => $matched) { $db->write_query("ALTER TABLE {$mybb->input['table']} DROP INDEX {$matches[1][$key]}"); $fulltext_to_create[$matches[1][$key]] = $matches[2][$key];
|
foreach($matches[0] as $key => $matched) { $db->write_query("ALTER TABLE {$mybb->input['table']} DROP INDEX {$matches[1][$key]}"); $fulltext_to_create[$matches[1][$key]] = $matches[2][$key];
|
} }
| } }
|
} }
| } }
|
Zeile 135 | Zeile 137 |
---|
// Build the actual strings for converting the columns $names = "CHANGE `{$column['Field']}` `{$column['Field']}` ";
|
// Build the actual strings for converting the columns $names = "CHANGE `{$column['Field']}` `{$column['Field']}` ";
|
$attributes = " DEFAULT "; if($column['Default'] == 'NULL')
| if(($db->type == 'mysql' || $db->type == 'mysqli') && in_array($type, $blob_types))
|
{
|
{
|
$attributes .= "NULL ";
| if($column['Null'] == 'YES') { $attributes = 'NULL'; } else { $attributes = 'NOT NULL'; }
|
} else {
|
} else {
|
$attributes .= "'".$db->escape_string($column['Default'])."' "; if($column['Null'] == 'YES') { $attributes .= 'NULL'; }
| $attributes = " DEFAULT "; if($column['Default'] == 'NULL') { $attributes .= "NULL "; }
|
else {
|
else {
|
$attributes .= 'NOT NULL';
| $attributes .= "'".$db->escape_string($column['Default'])."' "; if($column['Null'] == 'YES') { $attributes .= 'NULL'; } else { $attributes .= 'NOT NULL'; }
|
} }
|
} }
|
|
|
$convert_to_binary .= $comma.$names.preg_replace('/'.$type.'/i', $types[$type], $column['Type']).$attributes; $convert_to_utf8 .= "{$comma}{$names}{$column['Type']} CHARACTER SET utf8 COLLATE utf8_general_ci{$attributes}";
| $convert_to_binary .= $comma.$names.preg_replace('/'.$type.'/i', $types[$type], $column['Type']).$attributes; $convert_to_utf8 .= "{$comma}{$names}{$column['Type']} CHARACTER SET utf8 COLLATE utf8_general_ci{$attributes}";
|