plugin updates
This commit is contained in:
@@ -51,12 +51,12 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
|
||||
printf(
|
||||
/* translators: 1: WordPress version number, 2: Plural number of bugs. */
|
||||
_n(
|
||||
'<strong>Version %1$s</strong> addressed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed %2$s bugs.',
|
||||
4
|
||||
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed some security issues and fixed %2$s bugs.',
|
||||
21
|
||||
),
|
||||
'6.4.1',
|
||||
'4'
|
||||
'6.4.3',
|
||||
'21'
|
||||
);
|
||||
?>
|
||||
<?php
|
||||
@@ -66,11 +66,12 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
|
||||
sprintf(
|
||||
/* translators: %s: WordPress version. */
|
||||
esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
|
||||
sanitize_title( '6.4.1' )
|
||||
sanitize_title( '6.4.3' )
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
@@ -96,6 +97,32 @@ require_once ABSPATH . 'wp-admin/admin-header.php';
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: 1: WordPress version number, 2: Plural number of bugs. */
|
||||
_n(
|
||||
'<strong>Version %1$s</strong> addressed %2$s bug.',
|
||||
'<strong>Version %1$s</strong> addressed %2$s bugs.',
|
||||
4
|
||||
),
|
||||
'6.4.1',
|
||||
'4'
|
||||
);
|
||||
?>
|
||||
<?php
|
||||
printf(
|
||||
/* translators: %s: HelpHub URL. */
|
||||
__( 'For more information, see <a href="%s">the release notes</a>.' ),
|
||||
sprintf(
|
||||
/* translators: %s: WordPress version. */
|
||||
esc_url( __( 'https://wordpress.org/support/wordpress-version/version-%s/' ) ),
|
||||
sanitize_title( '6.4.1' )
|
||||
)
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -69,6 +69,30 @@ class File_Upload_Upgrader {
|
||||
wp_die( $file['error'] );
|
||||
}
|
||||
|
||||
if ( 'pluginzip' === $form || 'themezip' === $form ) {
|
||||
$archive_is_valid = false;
|
||||
|
||||
/** This filter is documented in wp-admin/includes/file.php */
|
||||
if ( class_exists( 'ZipArchive', false ) && apply_filters( 'unzip_file_use_ziparchive', true ) ) {
|
||||
$archive = new ZipArchive();
|
||||
$archive_is_valid = $archive->open( $file['file'], ZIPARCHIVE::CHECKCONS );
|
||||
|
||||
if ( true === $archive_is_valid ) {
|
||||
$archive->close();
|
||||
}
|
||||
} else {
|
||||
require_once ABSPATH . 'wp-admin/includes/class-pclzip.php';
|
||||
|
||||
$archive = new PclZip( $file['file'] );
|
||||
$archive_is_valid = is_array( $archive->properties() );
|
||||
}
|
||||
|
||||
if ( true !== $archive_is_valid ) {
|
||||
wp_delete_file( $file['file'] );
|
||||
wp_die( __( 'Incompatible Archive.' ) );
|
||||
}
|
||||
}
|
||||
|
||||
$this->filename = $_FILES[ $form ]['name'];
|
||||
$this->package = $file['file'];
|
||||
|
||||
|
||||
@@ -599,14 +599,12 @@ function populate_options( array $options = array() ) {
|
||||
$autoload = 'yes';
|
||||
}
|
||||
|
||||
if ( is_array( $value ) ) {
|
||||
$value = serialize( $value );
|
||||
}
|
||||
|
||||
if ( ! empty( $insert ) ) {
|
||||
$insert .= ', ';
|
||||
}
|
||||
|
||||
$value = maybe_serialize( sanitize_option( $option, $value ) );
|
||||
|
||||
$insert .= $wpdb->prepare( '(%s, %s, %s)', $option, $value, $autoload );
|
||||
}
|
||||
|
||||
|
||||
@@ -154,6 +154,10 @@ if ( isset( $_GET['action'] ) ) {
|
||||
|
||||
check_admin_referer( 'plugin-upload' );
|
||||
|
||||
if ( isset( $_FILES['pluginzip']['name'] ) && ! str_ends_with( strtolower( $_FILES['pluginzip']['name'] ), '.zip' ) ) {
|
||||
wp_die( __( 'Only .zip archives may be uploaded.' ) );
|
||||
}
|
||||
|
||||
$file_upload = new File_Upload_Upgrader( 'pluginzip', 'package' );
|
||||
|
||||
// Used in the HTML title tag.
|
||||
@@ -302,6 +306,10 @@ if ( isset( $_GET['action'] ) ) {
|
||||
|
||||
check_admin_referer( 'theme-upload' );
|
||||
|
||||
if ( isset( $_FILES['themezip']['name'] ) && ! str_ends_with( strtolower( $_FILES['themezip']['name'] ), '.zip' ) ) {
|
||||
wp_die( __( 'Only .zip archives may be uploaded.' ) );
|
||||
}
|
||||
|
||||
$file_upload = new File_Upload_Upgrader( 'themezip', 'package' );
|
||||
|
||||
// Used in the HTML title tag.
|
||||
|
||||
Reference in New Issue
Block a user