WordPress.org

Make WordPress Core

Ticket #34052: plugin-install.php.patch

File plugin-install.php.patch, 1.9 KB (added by floriansimeth, 5 years ago)
  • wp-admin/includes/plugin-install.php

     
    391391                'other_notes'  => _x( 'Other Notes',  'Plugin installer section title' )
    392392        );
    393393
     394        $api->sections = (array) $api->sections;
     395
    394396        // Sanitize HTML
    395         foreach ( (array) $api->sections as $section_name => $content ) {
     397        foreach ( $api->sections as $section_name => $content ) {
    396398                $api->sections[$section_name] = wp_kses( $content, $plugins_allowedtags );
    397399        }
    398400
     
    406408
    407409        $section = isset( $_REQUEST['section'] ) ? wp_unslash( $_REQUEST['section'] ) : 'description'; // Default to the Description tab, Do not translate, API returns English.
    408410        if ( empty( $section ) || ! isset( $api->sections[ $section ] ) ) {
    409                 $section_titles = array_keys( (array) $api->sections );
     411                $section_titles = array_keys( $api->sections );
    410412                $section = reset( $section_titles );
    411413        }
    412414
     
    436438        echo "<div id='{$_tab}-title' class='{$_with_banner}'><div class='vignette'></div><h2>{$api->name}</h2></div>";
    437439        echo "<div id='{$_tab}-tabs' class='{$_with_banner}'>\n";
    438440
    439         foreach ( (array) $api->sections as $section_name => $content ) {
     441        foreach ( $api->sections as $section_name => $content ) {
    440442                if ( 'reviews' === $section_name && ( empty( $api->ratings ) || 0 === array_sum( (array) $api->ratings ) ) ) {
    441443                        continue;
    442444                }
     
    546548                        echo '<div class="notice notice-warning"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been marked as compatible</strong> with your version of WordPress.') . '</p></div>';
    547549                }
    548550
    549                 foreach ( (array) $api->sections as $section_name => $content ) {
     551                foreach ( $api->sections as $section_name => $content ) {
    550552                        $content = links_add_base_url( $content, 'https://wordpress.org/plugins/' . $api->slug . '/' );
    551553                        $content = links_add_target( $content, '_blank' );
    552554