Make WordPress Core

Ticket #60578: 60578.patch

File 60578.patch, 1.0 KB (added by pmbaldha, 11 months ago)

Patch file

  • src/wp-admin/includes/class-file-upload-upgrader.php

     
    7272                        if ( 'pluginzip' === $form || 'themezip' === $form ) {
    7373                                if ( ! wp_zip_file_is_valid( $file['file'] ) ) {
    7474                                        wp_delete_file( $file['file'] );
    75                                         wp_die( __( 'Incompatible Archive.' ) );
     75                                        if ( 'pluginzip' === $form ) {
     76                                                $plugins_page = sprintf(
     77                                                        '<a href="%s">%s</a>',
     78                                                        self_admin_url( 'plugin-install.php' ),
     79                                                        __( 'Go to Plugin Installer' )
     80                                                );
     81                                                wp_die( __( 'Incompatible Archive.' ) . '<br>' . $plugins_page );
     82                                        } else {
     83                                                $themes_page = sprintf(
     84                                                        '<a href="%s" target="_parent">%s</a>',
     85                                                        self_admin_url( 'theme-install.php' ),
     86                                                        __( 'Go to Theme Installer' )
     87                                                );
     88                                                wp_die( __( 'Incompatible Archive.' ) . '<br>' . $themes_page );
     89                                        }
    7690                                }
    7791                        }
    7892