Changeset 12508 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload.php
- Timestamp:
- 03/29/2023 08:36:13 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/shortcodes/class-upload.php
r11403 r12508 28 28 ob_start(); 29 29 30 $uploader = new Upload_Handler(); 31 30 32 if ( is_user_logged_in() ) : 31 33 include_once ABSPATH . 'wp-admin/includes/template.php'; … … 58 60 ) : 59 61 if ( UPLOAD_ERR_OK === $_FILES['zip_file']['error'] ) : 60 $uploader = new Upload_Handler();61 62 $upload_result = $uploader->process_upload(); 62 63 … … 181 182 <?php wp_nonce_field( 'wporg-plugins-upload' ); ?> 182 183 <input type="hidden" name="action" value="upload"/> 184 <?php 185 if ( ! empty( $_REQUEST['upload_token'] ) ) { 186 printf( 187 '<input type="hidden" name="upload_token" value="%s"/>', 188 esc_attr( $_REQUEST['upload_token'] ) 189 ); 190 191 if ( ! $uploader->has_valid_upload_token() ) { 192 printf( 193 '<div class="notice notice-error notice-alt"><p>%s</p></div>', 194 esc_html__( 'The token provided is invalid for this user.', 'wporg-plugins') 195 ); 196 } 197 } 198 ?> 183 199 <?php 184 200 /*
Note: See TracChangeset
for help on using the changeset viewer.