Version Description
See: https://codex.buddypress.org/releases/version-5-1-1/
Download this release
Release Info
Developer | imath |
Plugin | BuddyPress |
Version | 5.1.1 |
Comparing to | |
See all releases |
Code changes from version 5.1.0 to 5.1.1
- bp-core/bp-core-attachments.php +1 -1
- bp-core/bp-core-avatars.php +37 -24
- bp-loader.php +1 -1
- buddypress.pot +6 -6
- class-buddypress.php +1 -1
- readme.txt +7 -1
bp-core/bp-core-attachments.php
CHANGED
@@ -1449,7 +1449,7 @@ function bp_attachments_cover_image_ajax_delete() {
|
|
1449 |
wp_send_json_error();
|
1450 |
}
|
1451 |
|
1452 |
-
if ( empty( $_POST['object'] ) || empty( $_POST['item_id'] ) ) {
|
1453 |
wp_send_json_error();
|
1454 |
}
|
1455 |
|
1449 |
wp_send_json_error();
|
1450 |
}
|
1451 |
|
1452 |
+
if ( empty( $_POST['object'] ) || empty( $_POST['item_id'] ) || ( ! ctype_digit( $_POST['item_id'] ) && ! is_int( $_POST['item_id'] ) ) ) {
|
1453 |
wp_send_json_error();
|
1454 |
}
|
1455 |
|
bp-core/bp-core-avatars.php
CHANGED
@@ -718,7 +718,6 @@ function bp_core_delete_existing_avatar( $args = '' ) {
|
|
718 |
);
|
719 |
|
720 |
$args = wp_parse_args( $args, $defaults );
|
721 |
-
extract( $args, EXTR_SKIP );
|
722 |
|
723 |
/**
|
724 |
* Filters whether or not to handle deleting an existing avatar.
|
@@ -745,47 +744,61 @@ function bp_core_delete_existing_avatar( $args = '' ) {
|
|
745 |
return true;
|
746 |
}
|
747 |
|
748 |
-
if ( empty( $item_id ) ) {
|
749 |
-
if ( 'user'
|
750 |
-
$item_id = bp_displayed_user_id();
|
751 |
-
elseif ( 'group'
|
752 |
-
$item_id = buddypress()->groups->current_group->id;
|
753 |
-
elseif ( 'blog'
|
754 |
-
$item_id = $current_blog->id;
|
|
|
755 |
|
756 |
/** This filter is documented in bp-core/bp-core-avatars.php */
|
757 |
-
$item_id = apply_filters( 'bp_core_avatar_item_id', $item_id, $object );
|
|
|
|
|
|
|
758 |
|
759 |
-
|
|
|
|
|
|
|
760 |
}
|
761 |
|
762 |
-
if ( empty( $avatar_dir ) ) {
|
763 |
-
if ( 'user'
|
764 |
-
$avatar_dir = 'avatars';
|
765 |
-
elseif ( 'group'
|
766 |
-
$avatar_dir = 'group-avatars';
|
767 |
-
elseif ( 'blog'
|
768 |
-
$avatar_dir = 'blog-avatars';
|
|
|
769 |
|
770 |
/** This filter is documented in bp-core/bp-core-avatars.php */
|
771 |
-
$avatar_dir = apply_filters( 'bp_core_avatar_dir', $avatar_dir, $object );
|
|
|
|
|
|
|
772 |
|
773 |
-
|
|
|
774 |
}
|
775 |
|
776 |
/** This filter is documented in bp-core/bp-core-avatars.php */
|
777 |
-
$avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', bp_core_avatar_upload_path() . '/' . $avatar_dir . '/' . $item_id, $item_id, $object, $avatar_dir );
|
778 |
|
779 |
-
if ( !
|
780 |
return false;
|
|
|
781 |
|
782 |
if ( $av_dir = opendir( $avatar_folder_dir ) ) {
|
783 |
-
while ( false !== ( $avatar_file = readdir($av_dir) ) ) {
|
784 |
-
if ( ( preg_match( "/-bpfull/", $avatar_file ) || preg_match( "/-bpthumb/", $avatar_file ) ) && '.' != $avatar_file && '..' != $avatar_file )
|
785 |
@unlink( $avatar_folder_dir . '/' . $avatar_file );
|
|
|
786 |
}
|
787 |
}
|
788 |
-
closedir($av_dir);
|
789 |
|
790 |
@rmdir( $avatar_folder_dir );
|
791 |
|
718 |
);
|
719 |
|
720 |
$args = wp_parse_args( $args, $defaults );
|
|
|
721 |
|
722 |
/**
|
723 |
* Filters whether or not to handle deleting an existing avatar.
|
744 |
return true;
|
745 |
}
|
746 |
|
747 |
+
if ( empty( $args['item_id'] ) ) {
|
748 |
+
if ( 'user' === $args['object'] ) {
|
749 |
+
$args['item_id'] = bp_displayed_user_id();
|
750 |
+
} elseif ( 'group' === $args['object'] ) {
|
751 |
+
$args['item_id'] = buddypress()->groups->current_group->id;
|
752 |
+
} elseif ( 'blog' === $args['object'] ) {
|
753 |
+
$args['item_id'] = $current_blog->id;
|
754 |
+
}
|
755 |
|
756 |
/** This filter is documented in bp-core/bp-core-avatars.php */
|
757 |
+
$item_id = apply_filters( 'bp_core_avatar_item_id', $args['item_id'], $args['object'] );
|
758 |
+
} else {
|
759 |
+
$item_id = $args['item_id'];
|
760 |
+
}
|
761 |
|
762 |
+
if ( $item_id && ( ctype_digit( $item_id ) || is_int( $item_id ) ) ) {
|
763 |
+
$item_id = (int) $item_id;
|
764 |
+
} else {
|
765 |
+
return false;
|
766 |
}
|
767 |
|
768 |
+
if ( empty( $args['avatar_dir'] ) ) {
|
769 |
+
if ( 'user' === $args['object'] ) {
|
770 |
+
$args['avatar_dir'] = 'avatars';
|
771 |
+
} elseif ( 'group' === $args['object'] ) {
|
772 |
+
$args['avatar_dir'] = 'group-avatars';
|
773 |
+
} elseif ( 'blog' === $args['object'] ) {
|
774 |
+
$args['avatar_dir'] = 'blog-avatars';
|
775 |
+
}
|
776 |
|
777 |
/** This filter is documented in bp-core/bp-core-avatars.php */
|
778 |
+
$avatar_dir = apply_filters( 'bp_core_avatar_dir', $args['avatar_dir'], $args['object'] );
|
779 |
+
} else {
|
780 |
+
$avatar_dir = $args['avatar_dir'];
|
781 |
+
}
|
782 |
|
783 |
+
if ( ! $avatar_dir ) {
|
784 |
+
return false;
|
785 |
}
|
786 |
|
787 |
/** This filter is documented in bp-core/bp-core-avatars.php */
|
788 |
+
$avatar_folder_dir = apply_filters( 'bp_core_avatar_folder_dir', bp_core_avatar_upload_path() . '/' . $avatar_dir . '/' . $item_id, $item_id, $args['object'], $avatar_dir );
|
789 |
|
790 |
+
if ( ! is_dir( $avatar_folder_dir ) ) {
|
791 |
return false;
|
792 |
+
}
|
793 |
|
794 |
if ( $av_dir = opendir( $avatar_folder_dir ) ) {
|
795 |
+
while ( false !== ( $avatar_file = readdir( $av_dir ) ) ) {
|
796 |
+
if ( ( preg_match( "/-bpfull/", $avatar_file ) || preg_match( "/-bpthumb/", $avatar_file ) ) && '.' != $avatar_file && '..' != $avatar_file ) {
|
797 |
@unlink( $avatar_folder_dir . '/' . $avatar_file );
|
798 |
+
}
|
799 |
}
|
800 |
}
|
801 |
+
closedir( $av_dir );
|
802 |
|
803 |
@rmdir( $avatar_folder_dir );
|
804 |
|
bp-loader.php
CHANGED
@@ -15,7 +15,7 @@
|
|
15 |
* Description: BuddyPress adds community features to WordPress. Member Profiles, Activity Streams, Direct Messaging, Notifications, and more!
|
16 |
* Author: The BuddyPress Community
|
17 |
* Author URI: https://buddypress.org/
|
18 |
-
* Version: 5.1.
|
19 |
* Text Domain: buddypress
|
20 |
* Domain Path: /bp-languages/
|
21 |
* License: GPLv2 or later (license.txt)
|
15 |
* Description: BuddyPress adds community features to WordPress. Member Profiles, Activity Streams, Direct Messaging, Notifications, and more!
|
16 |
* Author: The BuddyPress Community
|
17 |
* Author URI: https://buddypress.org/
|
18 |
+
* Version: 5.1.1
|
19 |
* Text Domain: buddypress
|
20 |
* Domain Path: /bp-languages/
|
21 |
* License: GPLv2 or later (license.txt)
|
buddypress.pot
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
# This file is distributed under the GPLv2 or later (license.txt).
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
-
"Project-Id-Version: BuddyPress 5.1.
|
6 |
"Report-Msgid-Bugs-To: https://buddypress.trac.wordpress.org\n"
|
7 |
-
"POT-Creation-Date: 2019-12-09
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=utf-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
@@ -2044,7 +2044,7 @@ msgstr ""
|
|
2044 |
msgid "HTTP error."
|
2045 |
msgstr ""
|
2046 |
|
2047 |
-
#: bp-core/bp-core-attachments.php:661 bp-core/bp-core-avatars.php:
|
2048 |
msgid "Upload failed."
|
2049 |
msgstr ""
|
2050 |
|
@@ -2144,7 +2144,7 @@ msgid ""
|
|
2144 |
"wide, and %2$spx tall."
|
2145 |
msgstr ""
|
2146 |
|
2147 |
-
#: bp-core/bp-core-attachments.php:1344 bp-core/bp-core-avatars.php:
|
2148 |
msgid "Upload Failed! Error was: %s"
|
2149 |
msgstr ""
|
2150 |
|
@@ -2156,12 +2156,12 @@ msgstr ""
|
|
2156 |
msgid "Profile Photo"
|
2157 |
msgstr ""
|
2158 |
|
2159 |
-
#: bp-core/bp-core-avatars.php:
|
2160 |
#. translators: %s is replaced with error message.
|
2161 |
msgid "Upload failed! Error was: %s"
|
2162 |
msgstr ""
|
2163 |
|
2164 |
-
#: bp-core/bp-core-avatars.php:
|
2165 |
msgid ""
|
2166 |
"You have selected an image that is smaller than recommended. For best "
|
2167 |
"results, upload a picture larger than %d x %d pixels."
|
2 |
# This file is distributed under the GPLv2 or later (license.txt).
|
3 |
msgid ""
|
4 |
msgstr ""
|
5 |
+
"Project-Id-Version: BuddyPress 5.1.1\n"
|
6 |
"Report-Msgid-Bugs-To: https://buddypress.trac.wordpress.org\n"
|
7 |
+
"POT-Creation-Date: 2019-12-23 09:08:12+00:00\n"
|
8 |
"MIME-Version: 1.0\n"
|
9 |
"Content-Type: text/plain; charset=utf-8\n"
|
10 |
"Content-Transfer-Encoding: 8bit\n"
|
2044 |
msgid "HTTP error."
|
2045 |
msgstr ""
|
2046 |
|
2047 |
+
#: bp-core/bp-core-attachments.php:661 bp-core/bp-core-avatars.php:1073
|
2048 |
msgid "Upload failed."
|
2049 |
msgstr ""
|
2050 |
|
2144 |
"wide, and %2$spx tall."
|
2145 |
msgstr ""
|
2146 |
|
2147 |
+
#: bp-core/bp-core-attachments.php:1344 bp-core/bp-core-avatars.php:916
|
2148 |
msgid "Upload Failed! Error was: %s"
|
2149 |
msgstr ""
|
2150 |
|
2156 |
msgid "Profile Photo"
|
2157 |
msgstr ""
|
2158 |
|
2159 |
+
#: bp-core/bp-core-avatars.php:944 bp-core/classes/trait-attachments.php:176
|
2160 |
#. translators: %s is replaced with error message.
|
2161 |
msgid "Upload failed! Error was: %s"
|
2162 |
msgstr ""
|
2163 |
|
2164 |
+
#: bp-core/bp-core-avatars.php:950
|
2165 |
msgid ""
|
2166 |
"You have selected an image that is smaller than recommended. For best "
|
2167 |
"results, upload a picture larger than %d x %d pixels."
|
class-buddypress.php
CHANGED
@@ -303,7 +303,7 @@ class BuddyPress {
|
|
303 |
|
304 |
/** Versions **********************************************************/
|
305 |
|
306 |
-
$this->version = '5.1.
|
307 |
$this->db_version = 12385;
|
308 |
|
309 |
/** Loading ***********************************************************/
|
303 |
|
304 |
/** Versions **********************************************************/
|
305 |
|
306 |
+
$this->version = '5.1.1';
|
307 |
$this->db_version = 12385;
|
308 |
|
309 |
/** Loading ***********************************************************/
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: user profiles, activity streams, messaging, friends, user groups, notifica
|
|
4 |
Requires at least: 4.7
|
5 |
Tested up to: 5.3
|
6 |
Requires PHP: 5.3
|
7 |
-
Stable tag: 5.1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -125,6 +125,9 @@ Try <a href="https://wordpress.org/plugins/bbpress/">bbPress</a>. It integrates
|
|
125 |
|
126 |
== Upgrade Notice ==
|
127 |
|
|
|
|
|
|
|
128 |
= 5.1.0 =
|
129 |
See: https://codex.buddypress.org/releases/version-5-1-0/
|
130 |
|
@@ -148,6 +151,9 @@ See: https://codex.buddypress.org/releases/version-4-0-0/
|
|
148 |
|
149 |
== Changelog ==
|
150 |
|
|
|
|
|
|
|
151 |
= 5.1.0 =
|
152 |
See: https://codex.buddypress.org/releases/version-5-1-0/
|
153 |
|
4 |
Requires at least: 4.7
|
5 |
Tested up to: 5.3
|
6 |
Requires PHP: 5.3
|
7 |
+
Stable tag: 5.1.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
125 |
|
126 |
== Upgrade Notice ==
|
127 |
|
128 |
+
= 5.1.1 =
|
129 |
+
See: https://codex.buddypress.org/releases/version-5-1-1/
|
130 |
+
|
131 |
= 5.1.0 =
|
132 |
See: https://codex.buddypress.org/releases/version-5-1-0/
|
133 |
|
151 |
|
152 |
== Changelog ==
|
153 |
|
154 |
+
= 5.1.1 =
|
155 |
+
See: https://codex.buddypress.org/releases/version-5-1-1/
|
156 |
+
|
157 |
= 5.1.0 =
|
158 |
See: https://codex.buddypress.org/releases/version-5-1-0/
|
159 |
|