Commit fd9795a8 authored by lucha's avatar lucha

[auto] plugin: buddypress 4.2.0

parent 962d217b
......@@ -662,6 +662,7 @@ function bp_blogs_update_post_activity_meta( $post, $activity, $activity_post_ob
$args['filter'] = array(
'object' => $activity_post_object->comments_tracking->component_id,
'action' => $activity_post_object->comments_tracking->action_id,
'primary_id' => get_current_blog_id(),
'secondary_id' => implode( ',', $comment_ids ),
);
......
......@@ -835,7 +835,7 @@ function bp_avatar_ajax_delete() {
// Handle delete.
if ( bp_core_delete_existing_avatar( array( 'item_id' => $avatar_data['item_id'], 'object' => $avatar_data['object'] ) ) ) {
$return = array(
'avatar' => html_entity_decode( bp_core_fetch_avatar( array(
'avatar' => esc_url( bp_core_fetch_avatar( array(
'object' => $avatar_data['object'],
'item_id' => $avatar_data['item_id'],
'html' => false,
......@@ -1273,7 +1273,7 @@ function bp_avatar_ajax_set() {
} else {
$return = array(
'avatar' => html_entity_decode( bp_core_fetch_avatar( array(
'avatar' => esc_url( bp_core_fetch_avatar( array(
'object' => $avatar_data['object'],
'item_id' => $avatar_data['item_id'],
'html' => false,
......@@ -1330,7 +1330,7 @@ function bp_avatar_ajax_set() {
// Handle crop.
if ( bp_core_avatar_handle_crop( $r ) ) {
$return = array(
'avatar' => html_entity_decode( bp_core_fetch_avatar( array(
'avatar' => esc_url( bp_core_fetch_avatar( array(
'object' => $avatar_data['object'],
'item_id' => $avatar_data['item_id'],
'html' => false,
......
......@@ -1202,8 +1202,13 @@ class BP_Groups_Group {
}
if ( ! is_null( $r['parent_id'] ) ) {
// Note that `wp_parse_id_list()` converts `false` to 0.
$parent_id = implode( ',', wp_parse_id_list( $r['parent_id'] ) );
// For legacy reasons, `false` means groups with no parent.
if ( false === $r['parent_id'] ) {
$parent_id = 0;
} else {
$parent_id = implode( ',', wp_parse_id_list( $r['parent_id'] ) );
}
$where_conditions['parent_id'] = "g.parent_id IN ({$parent_id})";
}
......
......@@ -15,7 +15,7 @@
* Description: BuddyPress adds community features to WordPress. Member Profiles, Activity Streams, Direct Messaging, Notifications, and more!
* Author: The BuddyPress Community
* Author URI: https://buddypress.org/
* Version: 4.1.0
* Version: 4.2.0
* Text Domain: buddypress
* Domain Path: /bp-languages/
* License: GPLv2 or later (license.txt)
......
......@@ -2417,6 +2417,11 @@ function bp_signup_avatar_dir_value() {
* @return bool
*/
function bp_signup_requires_privacy_policy_acceptance() {
// Bail if we're running a version of WP that doesn't have the Privacy Policy feature.
if ( version_compare( $GLOBALS['wp_version'], '4.9.6', '<' ) ) {
return false;
}
// Default to true when a published Privacy Policy page exists.
$privacy_policy_url = get_privacy_policy_url();
$required = ! empty( $privacy_policy_url );
......
......@@ -1636,14 +1636,22 @@ function bp_legacy_theme_ajax_messages_send_reply() {
check_ajax_referer( 'messages_send_message' );
$result = messages_new_message( array( 'thread_id' => (int) $_REQUEST['thread_id'], 'content' => $_REQUEST['content'] ) );
$thread_id = (int) $_POST['thread_id'];
// Cannot respond to a thread you're not already a recipient on.
if ( ! bp_current_user_can( 'bp_moderate' ) && ( ! messages_is_valid_thread( $thread_id ) || ! messages_check_thread_access( $thread_id ) ) ) {
echo "-1<div id='message' class='error'><p>" . __( 'There was a problem sending that reply. Please try again.', 'buddypress' ) . '</p></div>';
die;
}
$result = messages_new_message( array( 'thread_id' => $thread_id, 'content' => $_REQUEST['content'] ) );
if ( !empty( $result ) ) {
// Pretend we're in the message loop.
global $thread_template;
bp_thread_has_messages( array( 'thread_id' => (int) $_REQUEST['thread_id'] ) );
bp_thread_has_messages( array( 'thread_id' => $thread_id ) );
// Set the current message to the 2nd last.
$thread_template->message = end( $thread_template->thread->messages );
......
......@@ -14,11 +14,11 @@
?>
<script id="tmpl-bp-avatar-item" type="text/html">
<div id="avatar-to-crop">
<img src="{{data.url}}"/>
<img src="{{{data.url}}}"/>
</div>
<div class="avatar-crop-management">
<div id="avatar-crop-pane" class="avatar" style="width:{{data.full_w}}px; height:{{data.full_h}}px">
<img src="{{data.url}}" id="avatar-crop-preview"/>
<img src="{{{data.url}}}" id="avatar-crop-preview"/>
</div>
<div id="avatar-crop-actions">
<a class="button avatar-crop-submit" href="#"><?php esc_html_e( 'Crop Image', 'buddypress' ); ?></a>
......
......@@ -1866,9 +1866,16 @@ function bp_filter_request( object, filter, scope, target, search_terms, page, e
bp_ajax_request.abort();
}
// Get directory preferences (called "cookie" for legacy reasons).
var cookies = {};
cookies['bp-' + object + '-filter'] = bp_get_directory_preference( object, 'filter' );
cookies['bp' + object + '-scope'] = bp_get_directory_preference( object, 'scope' );
var cookie = encodeURIComponent( jq.param( cookies ) );
bp_ajax_request = jq.post( ajaxurl, {
action: object + '_filter',
'cookie': bp_get_cookies(),
'cookie': cookie,
'object': object,
'filter': filter,
'search_terms': search_terms,
......
......@@ -11,11 +11,11 @@
?>
<script id="tmpl-bp-avatar-item" type="text/html">
<div id="avatar-to-crop">
<img src="{{data.url}}"/>
<img src="{{{data.url}}}"/>
</div>
<div class="avatar-crop-management">
<div id="avatar-crop-pane" class="avatar" style="width:{{data.full_w}}px; height:{{data.full_h}}px">
<img src="{{data.url}}" id="avatar-crop-preview"/>
<img src="{{{data.url}}}" id="avatar-crop-preview"/>
</div>
<div id="avatar-crop-actions">
<button type="button" class="button avatar-crop-submit"><?php echo esc_html_x( 'Crop Image', 'button', 'buddypress' ); ?></button>
......
......@@ -123,8 +123,14 @@ function bp_nouveau_ajax_messages_send_reply() {
wp_send_json_error( $response );
}
$thread_id = (int) $_POST['thread_id'];
if ( ! bp_current_user_can( 'bp_moderate' ) && ( ! messages_is_valid_thread( $thread_id ) || ! messages_check_thread_access( $thread_id ) ) ) {
wp_send_json_error( $response );
}
$new_reply = messages_new_message( array(
'thread_id' => (int) $_POST['thread_id'],
'thread_id' => $thread_id,
'subject' => ! empty( $_POST['subject'] ) ? $_POST['subject'] : false,
'content' => $_POST['content']
) );
......@@ -143,7 +149,7 @@ function bp_nouveau_ajax_messages_send_reply() {
// Override bp_current_action().
$bp->current_action = 'view';
bp_thread_has_messages( array( 'thread_id' => (int) $_POST['thread_id'] ) );
bp_thread_has_messages( array( 'thread_id' => $thread_id ) );
// Set the current message to the 2nd last.
$thread_template->message = end( $thread_template->thread->messages );
......@@ -162,11 +168,11 @@ function bp_nouveau_ajax_messages_send_reply() {
// Output single message template part.
$reply = array(
'id' => bp_get_the_thread_message_id(),
'content' => html_entity_decode( do_shortcode( bp_get_the_thread_message_content() ) ),
'content' => do_shortcode( bp_get_the_thread_message_content() ),
'sender_id' => bp_get_the_thread_message_sender_id(),
'sender_name' => esc_html( bp_get_the_thread_message_sender_name() ),
'sender_link' => bp_get_the_thread_message_sender_link(),
'sender_avatar' => htmlspecialchars_decode( bp_core_fetch_avatar( array(
'sender_avatar' => esc_url( bp_core_fetch_avatar( array(
'item_id' => bp_get_the_thread_message_sender_id(),
'object' => 'user',
'type' => 'thumb',
......@@ -269,13 +275,13 @@ function bp_nouveau_ajax_get_user_message_threads() {
$threads->threads[ $i ] = array(
'id' => bp_get_message_thread_id(),
'message_id' => (int) $last_message_id,
'subject' => html_entity_decode( bp_get_message_thread_subject() ),
'excerpt' => html_entity_decode( bp_get_message_thread_excerpt() ),
'content' => html_entity_decode( do_shortcode( bp_get_message_thread_content() ) ),
'subject' => strip_tags( bp_get_message_thread_subject() ),
'excerpt' => strip_tags( bp_get_message_thread_excerpt() ),
'content' => do_shortcode( bp_get_message_thread_content() ),
'unread' => bp_message_thread_has_unread(),
'sender_name' => bp_core_get_user_displayname( $messages_template->thread->last_sender_id ),
'sender_link' => bp_core_get_userlink( $messages_template->thread->last_sender_id, false, true ),
'sender_avatar' => htmlspecialchars_decode( bp_core_fetch_avatar( array(
'sender_avatar' => esc_url( bp_core_fetch_avatar( array(
'item_id' => $messages_template->thread->last_sender_id,
'object' => 'user',
'type' => 'thumb',
......@@ -291,7 +297,7 @@ function bp_nouveau_ajax_get_user_message_threads() {
if ( is_array( $messages_template->thread->recipients ) ) {
foreach ( $messages_template->thread->recipients as $recipient ) {
$threads->threads[ $i ]['recipients'][] = array(
'avatar' => htmlspecialchars_decode( bp_core_fetch_avatar( array(
'avatar' => esc_url( bp_core_fetch_avatar( array(
'item_id' => $recipient->user_id,
'object' => 'user',
'type' => 'thumb',
......@@ -429,13 +435,13 @@ function bp_nouveau_ajax_get_thread_messages() {
if ( empty( $_POST['js_thread'] ) ) {
$thread->thread = array(
'id' => bp_get_the_thread_id(),
'subject' => html_entity_decode( bp_get_the_thread_subject() ),
'subject' => strip_tags( bp_get_the_thread_subject() ),
);
if ( is_array( $thread_template->thread->recipients ) ) {
foreach ( $thread_template->thread->recipients as $recipient ) {
$thread->thread['recipients'][] = array(
'avatar' => htmlspecialchars_decode( bp_core_fetch_avatar( array(
'avatar' => esc_url( bp_core_fetch_avatar( array(
'item_id' => $recipient->user_id,
'object' => 'user',
'type' => 'thumb',
......@@ -456,11 +462,11 @@ function bp_nouveau_ajax_get_thread_messages() {
while ( bp_thread_messages() ) : bp_thread_the_message();
$thread->messages[ $i ] = array(
'id' => bp_get_the_thread_message_id(),
'content' => html_entity_decode( do_shortcode( bp_get_the_thread_message_content() ) ),
'content' => do_shortcode( bp_get_the_thread_message_content() ),
'sender_id' => bp_get_the_thread_message_sender_id(),
'sender_name' => esc_html( bp_get_the_thread_message_sender_name() ),
'sender_link' => bp_get_the_thread_message_sender_link(),
'sender_avatar' => htmlspecialchars_decode( bp_core_fetch_avatar( array(
'sender_avatar' => esc_url( bp_core_fetch_avatar( array(
'item_id' => bp_get_the_thread_message_sender_id(),
'object' => 'user',
'type' => 'thumb',
......
# Copyright (C) 2018 The BuddyPress Community
# Copyright (C) 2019 The BuddyPress Community
# This file is distributed under the GPLv2 or later (license.txt).
msgid ""
msgstr ""
"Project-Id-Version: BuddyPress 4.1.0\n"
"Project-Id-Version: BuddyPress 4.2.0\n"
"Report-Msgid-Bugs-To: https://buddypress.trac.wordpress.org\n"
"POT-Creation-Date: 2018-12-05 15:46:31+00:00\n"
"POT-Creation-Date: 2019-02-20 15:34:23+00:00\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: 2018-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: 2019-MO-DA HO:MI+ZONE\n"
"Last-Translator: JOHN JAMES JACOBY <jjj@buddypress.org>\n"
"Language-Team: ENGLISH <jjj@buddypress.org>\n"
"X-Generator: grunt-wp-i18n1.0.2\n"
"X-Generator: grunt-wp-i18n 1.0.3\n"
#: bp-activity/actions/delete.php:52
#: bp-templates/bp-nouveau/includes/activity/ajax.php:249
......@@ -5146,11 +5146,11 @@ msgstr[1] ""
msgid "Viewing members of the type: %s"
msgstr ""
#: bp-members/bp-members-template.php:2487
#: bp-members/bp-members-template.php:2492
msgid "Your Profile Photo"
msgstr ""
#: bp-members/bp-members-template.php:2577
#: bp-members/bp-members-template.php:2582
msgid "Activity RSS Feed"
msgstr ""
......@@ -5613,7 +5613,7 @@ msgid "Messages marked as read"
msgstr ""
#: bp-messages/actions/bulk-manage.php:68
#: bp-templates/bp-nouveau/includes/messages/ajax.php:675
#: bp-templates/bp-nouveau/includes/messages/ajax.php:681
msgid "Messages marked as unread."
msgstr ""
......@@ -5687,7 +5687,7 @@ msgid "Message marked unread."
msgstr ""
#: bp-messages/actions/view.php:41
#: bp-templates/bp-nouveau/includes/messages/ajax.php:210
#: bp-templates/bp-nouveau/includes/messages/ajax.php:216
msgid "Your reply was sent successfully"
msgstr ""
......@@ -7231,8 +7231,8 @@ msgid "View Message"
msgstr ""
#: bp-templates/bp-legacy/buddypress/members/single/messages/messages-loop.php:195
#: bp-templates/bp-nouveau/includes/messages/ajax.php:247
#: bp-templates/bp-nouveau/includes/messages/ajax.php:404
#: bp-templates/bp-nouveau/includes/messages/ajax.php:253
#: bp-templates/bp-nouveau/includes/messages/ajax.php:410
msgid "Sorry, no messages were found."
msgstr ""
......@@ -7647,7 +7647,8 @@ msgstr ""
msgid "There was a problem closing the notice."
msgstr ""
#: bp-templates/bp-legacy/buddypress-functions.php:1675
#: bp-templates/bp-legacy/buddypress-functions.php:1643
#: bp-templates/bp-legacy/buddypress-functions.php:1683
msgid "There was a problem sending that reply. Please try again."
msgstr ""
......@@ -8708,52 +8709,52 @@ msgstr ""
msgid "Your reply was not sent. Please enter some content."
msgstr ""
#: bp-templates/bp-nouveau/includes/messages/ajax.php:223
#: bp-templates/bp-nouveau/includes/messages/ajax.php:398
#: bp-templates/bp-nouveau/includes/messages/ajax.php:229
#: bp-templates/bp-nouveau/includes/messages/ajax.php:404
msgid "Unauthorized request."
msgstr ""
#: bp-templates/bp-nouveau/includes/messages/ajax.php:513
#: bp-templates/bp-nouveau/includes/messages/ajax.php:519
msgid "There was a problem deleting your messages. Please try again."
msgstr ""
#: bp-templates/bp-nouveau/includes/messages/ajax.php:536
#: bp-templates/bp-nouveau/includes/messages/ajax.php:542
msgid "Messages deleted"
msgstr ""
#: bp-templates/bp-nouveau/includes/messages/ajax.php:552
#: bp-templates/bp-nouveau/includes/messages/ajax.php:558
msgid "There was a problem starring your messages. Please try again."
msgstr ""
#: bp-templates/bp-nouveau/includes/messages/ajax.php:554
#: bp-templates/bp-nouveau/includes/messages/ajax.php:560
msgid "There was a problem unstarring your messages. Please try again."
msgstr ""
#: bp-templates/bp-nouveau/includes/messages/ajax.php:628
#: bp-templates/bp-nouveau/includes/messages/ajax.php:634
msgid "Messages successfully starred."
msgstr ""
#: bp-templates/bp-nouveau/includes/messages/ajax.php:630
#: bp-templates/bp-nouveau/includes/messages/ajax.php:636
msgid "Messages successfully unstarred."
msgstr ""
#: bp-templates/bp-nouveau/includes/messages/ajax.php:651
#: bp-templates/bp-nouveau/includes/messages/ajax.php:657
msgid "There was a problem marking your messages as read. Please try again."
msgstr ""
#: bp-templates/bp-nouveau/includes/messages/ajax.php:657
#: bp-templates/bp-nouveau/includes/messages/ajax.php:663
msgid "There was a problem marking your messages as unread. Please try again."
msgstr ""
#: bp-templates/bp-nouveau/includes/messages/ajax.php:677
#: bp-templates/bp-nouveau/includes/messages/ajax.php:683
msgid "Messages marked as read."
msgstr ""
#: bp-templates/bp-nouveau/includes/messages/ajax.php:712
#: bp-templates/bp-nouveau/includes/messages/ajax.php:718
msgid "There was a problem dismissing the notice. Please try again."
msgstr ""
#: bp-templates/bp-nouveau/includes/messages/ajax.php:746
#: bp-templates/bp-nouveau/includes/messages/ajax.php:752
msgid "Sitewide notice dismissed"
msgstr ""
......
......@@ -303,7 +303,7 @@ class BuddyPress {
/** Versions **********************************************************/
$this->version = '4.1.0';
$this->version = '4.2.0';
$this->db_version = 11105;
/** Loading ***********************************************************/
......
......@@ -4,7 +4,7 @@ Tags: user profiles, activity streams, messaging, friends, user groups, notifica
Requires at least: 4.6
Tested up to: 5.0
Requires PHP: 5.3
Stable tag: 4.1.0
Stable tag: 4.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
......@@ -126,6 +126,9 @@ Try <a href="https://wordpress.org/plugins/bbpress/">bbPress</a>. It integrates
== Upgrade Notice ==
= 4.2.0 =
See: https://codex.buddypress.org/releases/version-4-2-0/
= 4.1.0 =
See: https://codex.buddypress.org/releases/version-4-1-0/
......@@ -134,9 +137,11 @@ See: https://codex.buddypress.org/releases/version-4-0-0/
== Changelog ==
= 4.2.0 =
See: https://codex.buddypress.org/releases/version-4-2-0/
= 4.1.0 =
See: https://codex.buddypress.org/releases/version-4-1-0/
= 4.0.0 =
See: https://codex.buddypress.org/releases/version-4-0-0/
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment