Changeset 47119 for trunk/src/wp-admin/includes/plugin-install.php
- Timestamp:
- 01/29/2020 12:33:45 AM (6 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/includes/plugin-install.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/plugin-install.php
r46463 r47119 101 101 */ 102 102 function plugins_api( $action, $args = array() ) { 103 // include an unmodified $wp_version103 // Include an unmodified $wp_version. 104 104 include( ABSPATH . WPINC . '/version.php' ); 105 105 … … 119 119 120 120 if ( ! isset( $args->wp_version ) ) { 121 $args->wp_version = substr( $wp_version, 0, 3 ); // X.y121 $args->wp_version = substr( $wp_version, 0, 3 ); // x.y 122 122 } 123 123 … … 286 286 echo $api_tags->get_error_message(); 287 287 } else { 288 // Set up the tags in a way which can be interpreted by wp_generate_tag_cloud()288 // Set up the tags in a way which can be interpreted by wp_generate_tag_cloud(). 289 289 $tags = array(); 290 290 foreach ( (array) $api_tags as $tag ) { … … 438 438 } 439 439 440 // Default to a "new" plugin 440 // Default to a "new" plugin. 441 441 $status = 'install'; 442 442 $url = false; … … 471 471 } 472 472 } else { 473 $key = array_keys( $installed_plugin ); 474 $key = reset( $key ); //Use the first plugin regardless of the name, Could have issues for multiple-plugins in one directory if they share different version numbers 473 $key = array_keys( $installed_plugin ); 474 // Use the first plugin regardless of the name. 475 // Could have issues for multiple plugins in one directory if they share different version numbers. 476 $key = reset( $key ); 477 475 478 $update_file = $api->slug . '/' . $key; 476 479 if ( version_compare( $api->version, $installed_plugin[ $key ]['Version'], '=' ) ) { … … 480 483 $version = $installed_plugin[ $key ]['Version']; 481 484 } else { 482 // If the above update check failed, Then that probably means that the update checker has out-of-date information, force a refresh485 // If the above update check failed, then that probably means that the update checker has out-of-date information, force a refresh. 483 486 if ( ! $loop ) { 484 487 delete_site_transient( 'update_plugins' ); … … 489 492 } 490 493 } else { 491 // "install" & no directory with that slug 494 // "install" & no directory with that slug. 492 495 if ( current_user_can( 'install_plugins' ) ) { 493 496 $url = wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=' . $api->slug ), 'install-plugin_' . $api->slug ); … … 571 574 ); 572 575 573 // Sanitize HTML 576 // Sanitize HTML. 574 577 foreach ( (array) $api->sections as $section_name => $content ) { 575 578 $api->sections[ $section_name ] = wp_kses( $content, $plugins_allowedtags ); … … 584 587 $_tab = esc_attr( $tab ); 585 588 586 $section = isset( $_REQUEST['section'] ) ? wp_unslash( $_REQUEST['section'] ) : 'description'; // Default to the Description tab, Do not translate, API returns English. 589 // Default to the Description tab, Do not translate, API returns English. 590 $section = isset( $_REQUEST['section'] ) ? wp_unslash( $_REQUEST['section'] ) : 'description'; 587 591 if ( empty( $section ) || ! isset( $api->sections[ $section ] ) ) { 588 592 $section_titles = array_keys( (array) $api->sections );
Note: See TracChangeset
for help on using the changeset viewer.