Ticket #49239: install-helper.php.patch
| File install-helper.php.patch, 2.5 KB (added by , 6 years ago) |
|---|
-
install-helper.php
52 52 function maybe_create_table( $table_name, $create_ddl ) { 53 53 global $wpdb; 54 54 foreach ( $wpdb->get_col( 'SHOW TABLES', 0 ) as $table ) { 55 if ( $table == $table_name ) {55 if ( $table === $table_name ) { 56 56 return true; 57 57 } 58 58 } … … 61 61 62 62 // We cannot directly tell that whether this succeeded! 63 63 foreach ( $wpdb->get_col( 'SHOW TABLES', 0 ) as $table ) { 64 if ( $table == $table_name ) {64 if ( $table === $table_name ) { 65 65 return true; 66 66 } 67 67 } … … 86 86 global $wpdb; 87 87 foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) { 88 88 89 if ( $column == $column_name ) {89 if ( $column === $column_name ) { 90 90 return true; 91 91 } 92 92 } … … 96 96 97 97 // We cannot directly tell that whether this succeeded! 98 98 foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) { 99 if ( $column == $column_name ) {99 if ( $column === $column_name ) { 100 100 return true; 101 101 } 102 102 } … … 119 119 function maybe_drop_column( $table_name, $column_name, $drop_ddl ) { 120 120 global $wpdb; 121 121 foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) { 122 if ( $column == $column_name ) {122 if ( $column === $column_name ) { 123 123 124 124 // Found it, so try to drop it. 125 125 $wpdb->query( $drop_ddl ); … … 126 126 127 127 // We cannot directly tell that whether this succeeded! 128 128 foreach ( $wpdb->get_col( "DESC $table_name", 0 ) as $column ) { 129 if ( $column == $column_name ) {129 if ( $column === $column_name ) { 130 130 return false; 131 131 } 132 132 } … … 172 172 173 173 foreach ( $results as $row ) { 174 174 175 if ( $row->Field == $col_name ) {175 if ( $row->Field === $col_name ) { 176 176 177 177 // Got our column, check the params. 178 if ( ( $col_type != null ) && ( $row->Type != $col_type ) ) {178 if ( ( $col_type != null ) && ( $row->Type !== $col_type ) ) { 179 179 ++$diffs; 180 180 } 181 181 if ( ( $is_null != null ) && ( $row->Null != $is_null ) ) { 182 182 ++$diffs; 183 183 } 184 if ( ( $key != null ) && ( $row->Key != $key ) ) {184 if ( ( $key != null ) && ( $row->Key !== $key ) ) { 185 185 ++$diffs; 186 186 } 187 if ( ( $default != null ) && ( $row->Default != $default ) ) {187 if ( ( $default !== null ) && ( $row->Default !== $default ) ) { 188 188 ++$diffs; 189 189 } 190 if ( ( $extra != null ) && ( $row->Extra != $extra ) ) {190 if ( ( $extra !== null ) && ( $row->Extra !== $extra ) ) { 191 191 ++$diffs; 192 192 } 193 193 if ( $diffs > 0 ) {