Skip to content

Commit

Permalink
"Fix" #0016431: Numerous "Invalid argument supplied for foreach()" er…
Browse files Browse the repository at this point in the history
…rors when installing with DB script printed to screen
  • Loading branch information
mantis committed Sep 30, 2013
1 parent 930c6c3 commit 4231e1b
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions core/database_api.php
Expand Up @@ -604,11 +604,13 @@ function db_index_exists( $p_table_name, $p_index_name ) {

$t_indexes = $g_db->MetaIndexes( $p_table_name );

# Can't use in_array() since it is case sensitive
$t_index_name = utf8_strtolower( $p_index_name );
foreach( $t_indexes as $t_current_index_name => $t_current_index_obj ) {
if( utf8_strtolower( $t_current_index_name ) == $t_index_name ) {
return true;
if( !empty( $t_indexes ) ) {
# Can't use in_array() since it is case sensitive
$t_index_name = utf8_strtolower( $p_index_name );
foreach( $t_indexes as $t_current_index_name => $t_current_index_obj ) {
if( utf8_strtolower( $t_current_index_name ) == $t_index_name ) {
return true;
}
}
}
return false;
Expand Down

0 comments on commit 4231e1b

Please sign in to comment.