Changeset 9826 for trunk/src/bp-core/bp-core-avatars.php
- Timestamp:
- 04/30/2015 07:57:11 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-avatars.php
r9819 r9826 948 948 } 949 949 950 // Init the feedback message 951 $feedback_message = false; 952 953 if ( ! empty( $bp->template_message ) ) { 954 $feedback_message = $bp->template_message; 955 956 // Remove template message. 957 $bp->template_message = false; 958 $bp->template_message_type = false; 959 @setcookie( 'bp-message', false, time() - 1000, COOKIEPATH ); 960 @setcookie( 'bp-message-type', false, time() - 1000, COOKIEPATH ); 961 } 962 950 963 if ( empty( $avatar ) ) { 951 964 // Default upload error 952 $message = array(); 953 954 // Intercept the template message and remove it 955 if ( ! empty( $bp->template_message ) ) { 956 // Set the feedback message 957 $message = array( 958 'type' => 'upload_error', 959 'message' => $bp->template_message, 960 ); 961 962 // Remove template message. 963 $bp->template_message = false; 964 $bp->template_message_type = false; 965 @setcookie( 'bp-message', false, time() - 1000, COOKIEPATH ); 966 @setcookie( 'bp-message-type', false, time() - 1000, COOKIEPATH ); 967 } 968 969 bp_attachments_json_response( false, $is_html4, $message ); 965 $message = __( 'Upload failed.', 'buddypress' ); 966 967 // Use the template message if set 968 if ( ! empty( $feedback_message ) ) { 969 $message = $feedback_message; 970 } 971 972 // Upload error reply 973 bp_attachments_json_response( false, $is_html4, array( 974 'type' => 'upload_error', 975 'message' => $message, 976 ) ); 970 977 } 971 978 … … 991 998 'width' => $uploaded_image[0], 992 999 'height' => $uploaded_image[1], 1000 'feedback' => $feedback_message, 993 1001 ) ); 994 1002 }
Note: See TracChangeset
for help on using the changeset viewer.