Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/29/2015 06:25:35 PM (5 years ago)
Author:
imath
Message:

Improve the BP_Attachment class

  • abstract the BP_Attachment class, so it must be extended,
  • avoid using get_class_vars( __CLASS__ ) to get the default values in the constructor,
  • sanitize the base_dir if set,
  • make sure the action and file_input parameters are sanitized,
  • use a is_dir() check instead of a file_exists() one when checking if the upload_path exists,
  • use bp_parse_args() in the BP_Attachment->crop() method and include a filter,
  • improve code formatting.

Props DJPaul

See #6278

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/classes/class-bp-attachment-avatar.php

    r9623 r9660  
    8686
    8787        // File is of invalid type
    88         } else if ( ! bp_core_check_avatar_type( array( 'file' => $file ) ) ) {
     88        } elseif ( ! bp_core_check_avatar_type( array( 'file' => $file ) ) ) {
    8989            $file['error'] = 10;
    9090        }
Note: See TracChangeset for help on using the changeset viewer.