Ticket #49239: admin.php.patch
| File admin.php.patch, 2.7 KB (added by , 6 years ago) |
|---|
-
admin.php
45 45 * @since 2.8.0 46 46 */ 47 47 do_action( 'after_db_upgrade' ); 48 } elseif ( get_option( 'db_version' ) != $wp_db_version && empty( $_POST ) ) {48 } elseif ( get_option( 'db_version' ) !== $wp_db_version && empty( $_POST ) ) { 49 49 if ( ! is_multisite() ) { 50 50 wp_redirect( admin_url( 'upgrade.php?_wp_http_referer=' . urlencode( wp_unslash( $_SERVER['REQUEST_URI'] ) ) ) ); 51 51 exit; … … 72 72 * If there are 50 or fewer sites, run every time. Otherwise, throttle to reduce load: 73 73 * attempt to do no more than threshold value, with some +/- allowed. 74 74 */ 75 if ( $c <= 50 || ( $c > 50 && mt_rand( 0, (int) ( $c / 50 ) ) == 1) ) {75 if ( $c <= 50 || ( $c > 50 && 1 === mt_rand( 0, (int) ( $c / 50 ) ) ) ) { 76 76 require_once( ABSPATH . WPINC . '/http.php' ); 77 77 $response = wp_remote_get( 78 78 admin_url( 'upgrade.php?step=1' ), … … 181 181 $page_hook = get_plugin_page_hook( $plugin_page, $plugin_page ); 182 182 183 183 // Back-compat for plugins using add_management_page(). 184 if ( empty( $page_hook ) && 'edit.php' == $pagenow && '' != get_plugin_page_hook( $plugin_page, 'tools.php' ) ) {184 if ( empty( $page_hook ) && 'edit.php' === $pagenow && '' !== get_plugin_page_hook( $plugin_page, 'tools.php' ) ) { 185 185 // There could be plugin specific params on the URL, so we need the whole query string 186 186 if ( ! empty( $_SERVER['QUERY_STRING'] ) ) { 187 187 $query_string = $_SERVER['QUERY_STRING']; … … 370 370 * The following hooks are fired to ensure backward compatibility. 371 371 * In all other cases, 'load-' . $pagenow should be used instead. 372 372 */ 373 if ( $typenow == 'page') {374 if ( $pagenow == 'post-new.php') {373 if ( 'page' === $typenow ) { 374 if ( 'post-new.php' === $pagenow ) { 375 375 do_action( 'load-page-new.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores 376 } elseif ( $pagenow == 'post.php') {376 } elseif ( 'post.php' === $pagenow ) { 377 377 do_action( 'load-page.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores 378 378 } 379 } elseif ( $pagenow == 'edit-tags.php') {380 if ( $taxnow == 'category') {379 } elseif ( 'edit-tags.php' === $pagenow ) { 380 if ( 'category' === $taxnow ) { 381 381 do_action( 'load-categories.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores 382 } elseif ( $taxnow == 'link_category') {382 } elseif ( 'link_category' === $taxnow ) { 383 383 do_action( 'load-edit-link-categories.php' ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores 384 384 } 385 385 } elseif ( 'term.php' === $pagenow ) {