Changeset 47219 for trunk/src/wp-admin/includes/upgrade.php
- Timestamp:
- 02/09/2020 04:52:28 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/upgrade.php
r47198 r47219 162 162 if ( global_terms_enabled() ) { 163 163 $cat_id = $wpdb->get_var( $wpdb->prepare( "SELECT cat_ID FROM {$wpdb->sitecategories} WHERE category_nicename = %s", $cat_slug ) ); 164 if ( $cat_id == null) {164 if ( null == $cat_id ) { 165 165 $wpdb->insert( 166 166 $wpdb->sitecategories, … … 496 496 // Delete any caps that snuck into the previously active blog. (Hardcoded to blog 1 for now.) 497 497 // TODO: Get previous_blog_id. 498 if ( ! is_super_admin( $user_id ) && $user_id != 1) {498 if ( ! is_super_admin( $user_id ) && 1 != $user_id ) { 499 499 $wpdb->delete( 500 500 $wpdb->usermeta, … … 567 567 $response = wp_remote_get( $test_url, array( 'timeout' => 5 ) ); 568 568 $x_pingback_header = wp_remote_retrieve_header( $response, 'x-pingback' ); 569 $pretty_permalinks = $x_pingback_header && $x_pingback_header === get_bloginfo( 'pingback_url' );569 $pretty_permalinks = $x_pingback_header && get_bloginfo( 'pingback_url' ) === $x_pingback_header; 570 570 571 571 if ( $pretty_permalinks ) { … … 1128 1128 if ( isset( $user->user_idmode ) ) : 1129 1129 $idmode = $user->user_idmode; 1130 if ( $idmode == 'nickname') {1130 if ( 'nickname' === $idmode ) { 1131 1131 $id = $user->user_nickname; 1132 1132 } 1133 if ( $idmode == 'login') {1133 if ( 'login' === $idmode ) { 1134 1134 $id = $user->user_login; 1135 1135 } 1136 if ( $idmode == 'firstname') {1136 if ( 'firstname' === $idmode ) { 1137 1137 $id = $user->user_firstname; 1138 1138 } 1139 if ( $idmode == 'lastname') {1139 if ( 'lastname' === $idmode ) { 1140 1140 $id = $user->user_lastname; 1141 1141 } 1142 if ( $idmode == 'namefl') {1142 if ( 'namefl' === $idmode ) { 1143 1143 $id = $user->user_firstname . ' ' . $user->user_lastname; 1144 1144 } 1145 if ( $idmode == 'namelf') {1145 if ( 'namelf' === $idmode ) { 1146 1146 $id = $user->user_lastname . ' ' . $user->user_firstname; 1147 1147 } … … 2250 2250 2251 2251 // 4.2 2252 if ( $wp_current_db_version < 31351 && $wpdb->charset === 'utf8mb4') {2252 if ( $wp_current_db_version < 31351 && 'utf8mb4' === $wpdb->charset ) { 2253 2253 if ( wp_should_upgrade_global_tables() ) { 2254 2254 $wpdb->query( "ALTER TABLE $wpdb->usermeta DROP INDEX meta_key, ADD INDEX meta_key(meta_key(191))" ); … … 2500 2500 global $wpdb; 2501 2501 2502 if ( $setting == 'home'&& defined( 'WP_HOME' ) ) {2502 if ( 'home' === $setting && defined( 'WP_HOME' ) ) { 2503 2503 return untrailingslashit( WP_HOME ); 2504 2504 } 2505 2505 2506 if ( $setting == 'siteurl'&& defined( 'WP_SITEURL' ) ) {2506 if ( 'siteurl' === $setting && defined( 'WP_SITEURL' ) ) { 2507 2507 return untrailingslashit( WP_SITEURL ); 2508 2508 } … … 2510 2510 $option = $wpdb->get_var( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = %s", $setting ) ); 2511 2511 2512 if ( 'home' == $setting && '' == $option ) {2512 if ( 'home' === $setting && '' == $option ) { 2513 2513 return __get_option( 'siteurl' ); 2514 2514 } 2515 2515 2516 if ( 'siteurl' == $setting || 'home' == $setting || 'category_base' == $setting || 'tag_base'== $setting ) {2516 if ( 'siteurl' === $setting || 'home' === $setting || 'category_base' === $setting || 'tag_base' === $setting ) { 2517 2517 $option = untrailingslashit( $option ); 2518 2518 } … … 2862 2862 'subpart' => $tableindex->Sub_part, 2863 2863 ); 2864 $index_ary[ $keyname ]['unique'] = ( $tableindex->Non_unique == 0) ? true : false;2864 $index_ary[ $keyname ]['unique'] = ( 0 == $tableindex->Non_unique ) ? true : false; 2865 2865 $index_ary[ $keyname ]['index_type'] = $tableindex->Index_type; 2866 2866 } … … 2871 2871 // Build a create string to compare to the query. 2872 2872 $index_string = ''; 2873 if ( $index_name == 'primary') {2873 if ( 'primary' === $index_name ) { 2874 2874 $index_string .= 'PRIMARY '; 2875 2875 } elseif ( $index_data['unique'] ) { … … 2890 2890 // For each column in the index. 2891 2891 foreach ( $index_data['columns'] as $column_data ) { 2892 if ( $index_columns != '') {2892 if ( '' != $index_columns ) { 2893 2893 $index_columns .= ','; 2894 2894 } … … 3001 3001 3002 3002 foreach ( $files as $oldfile => $newfile ) { 3003 if ( $oldfile == 'index.php') {3003 if ( 'index.php' === $oldfile ) { 3004 3004 $oldpath = $home_path; 3005 3005 } else { … … 3008 3008 3009 3009 // Check to make sure it's not a new index. 3010 if ( $oldfile == 'index.php') {3010 if ( 'index.php' === $oldfile ) { 3011 3011 $index = implode( '', file( "$oldpath/$oldfile" ) ); 3012 3012 if ( strpos( $index, 'WP_USE_THEMES' ) !== false ) { … … 3184 3184 // Make the new site theme active. 3185 3185 $current_template = __get_option( 'template' ); 3186 if ( $current_template == WP_DEFAULT_THEME) {3186 if ( WP_DEFAULT_THEME == $current_template ) { 3187 3187 update_option( 'template', $template ); 3188 3188 update_option( 'stylesheet', $template );
Note: See TracChangeset
for help on using the changeset viewer.