只需更改/wp内容/插件/buddypress/bp核心/bp核心附件。php文件
}
// Make sure the file path is safe.
if ( 0 !== validate_file( $r[\'image\'] ) ) { //this to following one
if ( 1 === validate_file( $r[\'image\'] ) ) {
return false;
}
$type_subdir = $r[\'object_dir\'] . \'/\' . $r[\'item_id\'] . \'/\' . $r[\'type\'];
$type_dir = trailingslashit( $bp_attachments_uploads_dir[\'basedir\'] ) . $type_subdir;
if ( 0 !== validate_file( $type_dir ) || ! is_dir( $type_dir ) ) { //this to following one
if ( 1 === validate_file( $type_dir ) || ! is_dir( $type_dir ) ) {
return $attachment_data;
}
$cover_subdir = $object_data[\'dir\'] . \'/\' . $bp_params[\'item_id\'] . \'/cover-image\';
$cover_dir = trailingslashit( $bp_attachments_uploads_dir[\'basedir\'] ) . $cover_subdir;
if ( 0 !== validate_file( $cover_dir ) || ! is_dir( $cover_dir ) ) { //this to following one
if ( 1 === validate_file( $cover_dir ) || ! is_dir( $cover_dir ) ) {
// Upload error response.
bp_attachments_json_response( false, $is_html4, array(
\'type\' => \'upload_error\',