Changeset 369 for trunk/bp-core/bp-core-avatars.php
- Timestamp:
- 10/01/2008 08:35:54 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/bp-core/bp-core-avatars.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-avatars.php
r363 r369 73 73 // Main UI Rendering 74 74 function bp_core_avatar_admin( $message = null, $action = null, $delete_action = null ) { 75 global $wp_upload_error; 75 76 ?> 76 77 <?php if ( !isset($_POST['slick_avatars_action']) && !isset($_GET['slick_avatars_action']) ) { ?> … … 117 118 bp_core_ap_die( 'Security error.' ); 118 119 120 // Set friendly error feedback. 121 $uploadErrors = array( 122 0 => __("There is no error, the file uploaded with success"), 123 1 => __("The uploaded file exceeds the upload_max_filesize directive in php.ini"), 124 2 => __("The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form"), 125 3 => __("The uploaded file was only partially uploaded"), 126 4 => __("No file was uploaded"), 127 6 => __("Missing a temporary folder") 128 ); 129 119 130 if ( !bp_core_check_avatar_upload($_FILES) ) 120 bp_core_ap_die( 'Your upload failed, please try again. ');131 bp_core_ap_die( 'Your upload failed, please try again. Error was: ' . $uploadErrors[$_FILES['file']['error']] ); 121 132 122 133 if ( !bp_core_check_avatar_size($_FILES) ) … … 128 139 // "Handle" upload into temporary location 129 140 if ( !$original = bp_core_handle_avatar_upload($_FILES) ) 130 bp_core_ap_die( 'Upload Failed! Your image is likely too big.');141 bp_core_ap_die( 'Upload Failed! Error was: ' . $wp_upload_error ); 131 142 132 143 if ( !bp_core_check_avatar_dimensions($original) ) … … 210 221 211 222 function bp_core_handle_avatar_upload($file) { 223 global $wp_upload_error; 224 212 225 $res = wp_handle_upload( $file['file'], array('action'=>'slick_avatars') ); 213 226 if ( !in_array('error', array_keys($res) ) ) { 214 227 return $res['file']; 215 228 } else { 229 $wp_upload_error = $res['error']; 216 230 return false; 217 231 }
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)