Ticket #2821: 2821.2.patch
File 2821.2.patch, 1.5 KB (added by , 8 years ago) |
---|
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload-handler.php
83 83 } 84 84 85 85 // Determine the plugin slug based on the name of the plugin in the main plugin file. 86 $this->plugin_slug = sanitize_title_with_dashes( $this->plugin['Name'] ); 86 $this->plugin_slug = remove_accents( $this->plugin['Name'] ); 87 $this->plugin_slug = preg_replace( '/[^a-z0-9 _.-]/i', '', $this->plugin_slug ); 88 $this->plugin_slug = sanitize_title_with_dashes( $this->plugin_slug ); 87 89 90 if ( ! $this->plugin_slug ) { 91 $error = __( 'The plugin has an unsupported name.', 'wporg-plugins' ); 92 93 /* translators: %s: 'Plugin Name:' */ 94 return $error . ' ' . sprintf( __( 'Plugin names can only contain latin letters (A-z), numbers, spaces, and hyphens. Please change the %s line in your main plugin file and upload it again.', 'wporg-plugins' ), 95 esc_html( $this->plugin['Name'] ), 96 '<code>Plugin Name:</code>' 97 ); 98 } 99 88 100 // Make sure it doesn't use a slug deemed not to be used by the public. 89 101 if ( $this->has_reserved_slug() ) { 90 102 $error = __( 'The plugin has a reserved name.', 'wporg-plugins' );