Skip to content

Commit 976f587

Browse files
committed
Update BuddyPress plugin from 14.3.4 to 14.4.0
1 parent 8909503 commit 976f587

6 files changed

Lines changed: 142 additions & 58 deletions

File tree

wp-content/plugins/buddypress/bp-core/bp-core-functions.php

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4577,10 +4577,18 @@ function bp_email_unsubscribe_handler() {
45774577

45784578
// Unsubscribe.
45794579
$meta_key = $emails[ $raw_email_type ]['unsubscribe']['meta_key'];
4580-
bp_update_user_meta( $raw_user_id, $meta_key, 'no' );
4580+
4581+
if ( 'no' !== bp_get_user_meta( $raw_user_id, $meta_key, true ) ) {
4582+
bp_update_user_meta( $raw_user_id, $meta_key, 'no' );
4583+
}
45814584

45824585
$result_msg = $emails[ $raw_email_type ]['unsubscribe']['message'];
4583-
$unsub_msg = __( 'You can change this or any other email notification preferences in your email settings.', 'buddypress' );
4586+
4587+
if ( bp_is_active( 'settings' ) ) {
4588+
$unsub_msg = __( 'You can change this or any other email notification preferences in your email settings.', 'buddypress' );
4589+
} else {
4590+
$unsub_msg = '';
4591+
}
45844592
}
45854593

45864594
if ( $raw_user_id && $redirect_to ) {
@@ -4592,8 +4600,19 @@ function bp_email_unsubscribe_handler() {
45924600
);
45934601

45944602
// Template notices are only displayed on BP pages.
4595-
bp_core_add_message( $message );
4596-
bp_core_redirect( bp_members_get_user_url( $raw_user_id ) );
4603+
if ( is_user_logged_in() ) {
4604+
bp_core_add_message( $message );
4605+
bp_core_redirect( bp_members_get_user_url( $raw_user_id ) );
4606+
} else {
4607+
wp_die(
4608+
sprintf( '%1$s <a href="%2$s">%3$s</a>', esc_html( $result_msg ), esc_url( $redirect_to ), esc_html( $unsub_msg ) ),
4609+
esc_html( $unsub_msg ),
4610+
array(
4611+
'link_url' => esc_url( home_url() ),
4612+
'link_text' => esc_html__( 'Go to website\'s home page.', 'buddypress' ),
4613+
)
4614+
);
4615+
}
45974616

45984617
exit;
45994618
} else {

wp-content/plugins/buddypress/bp-loader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* Domain Path: /bp-languages/
2222
* Requires PHP: 5.6
2323
* Requires at least: 6.1
24-
* Version: 14.3.4
24+
* Version: 14.4.0
2525
*/
2626

2727
/**

wp-content/plugins/buddypress/bp-members/classes/class-bp-rest-signup-endpoint.php

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ public function activate_item( $request ) {
706706
$activation_key = $request->get_param( 'activation_key' );
707707

708708
// Get the signup to activate thanks to the activation key.
709-
$signup = $this->get_signup_object( $activation_key );
709+
$signup = $this->get_signup_object_by_field( $activation_key, 'activation_key' );
710710
$activated = bp_core_activate_signup( $activation_key );
711711

712712
if ( ! $activated ) {
@@ -761,8 +761,19 @@ public function activate_item_permissions_check( $request ) {
761761
// Get the activation key.
762762
$activation_key = $request->get_param( 'activation_key' );
763763

764+
// Block numeric IDs to prevent enumeration attacks.
765+
if ( is_numeric( $activation_key ) ) {
766+
return new WP_Error(
767+
'bp_rest_invalid_activation_key_format',
768+
__( 'Invalid activation key format.', 'buddypress' ),
769+
array(
770+
'status' => 400,
771+
)
772+
);
773+
}
774+
764775
// Check the activation key is valid.
765-
if ( $this->get_signup_object( $activation_key ) ) {
776+
if ( $this->get_signup_object_by_field( $activation_key, 'activation_key' ) ) {
766777
$retval = true;
767778
}
768779

@@ -988,6 +999,49 @@ public function get_signup_object( $identifier ) {
988999
return false;
9891000
}
9901001

1002+
/**
1003+
* Get signup object by specific field with security validation.
1004+
*
1005+
* @since 14.4.0
1006+
*
1007+
* @param int|string $identifier Signup identifier.
1008+
* @param string $field Signup lookup field ('id', 'email', or 'activation_key').
1009+
* @return BP_Signup|false
1010+
*/
1011+
public function get_signup_object_by_field( $identifier, $field ) {
1012+
$signup_args = array();
1013+
1014+
if ( 'id' === $field && is_numeric( $identifier ) ) {
1015+
$signup_args['include'] = array( intval( $identifier ) );
1016+
} else if ( 'email' === $field && is_email( $identifier ) ) {
1017+
$signup_args['usersearch'] = $identifier;
1018+
} else if ( 'activation_key' === $field ) {
1019+
// The activation key is used when activating a signup.
1020+
1021+
// Block numeric IDs to prevent enumeration attacks.
1022+
if ( is_numeric( $identifier ) ) {
1023+
return false;
1024+
}
1025+
1026+
// Basic validation: minimum length check.
1027+
if ( empty( $identifier ) || strlen( $identifier ) < 10 ) {
1028+
return false;
1029+
}
1030+
$signup_args['activation_key'] = $identifier;
1031+
}
1032+
1033+
if ( ! empty( $signup_args ) ) {
1034+
// Get signups.
1035+
$signups = \BP_Signup::get( $signup_args );
1036+
1037+
if ( ! empty( $signups['signups'] ) ) {
1038+
return reset( $signups['signups'] );
1039+
}
1040+
}
1041+
1042+
return false;
1043+
}
1044+
9911045
/**
9921046
* Check a user password for the REST API.
9931047
*

wp-content/plugins/buddypress/buddypress.pot

Lines changed: 53 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ msgstr ""
99
"MIME-Version: 1.0\n"
1010
"Content-Type: text/plain; charset=UTF-8\n"
1111
"Content-Transfer-Encoding: 8bit\n"
12-
"POT-Creation-Date: 2025-03-20T18:57:16+00:00\n"
12+
"POT-Creation-Date: 2025-09-23T15:34:25+00:00\n"
1313
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1414
"X-Generator: WP-CLI 2.11.0\n"
1515
"X-Domain: buddypress\n"
@@ -1473,13 +1473,13 @@ msgstr ""
14731473
#: bp-activity/classes/class-bp-rest-activity-endpoint.php:1517
14741474
#: bp-blogs/classes/class-bp-rest-blogs-endpoint.php:817
14751475
#: bp-members/classes/class-bp-rest-members-endpoint.php:1254
1476-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1292
1476+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1346
14771477
msgid "Ensure result set includes specific IDs."
14781478
msgstr ""
14791479

14801480
#: bp-activity/classes/class-bp-rest-activity-endpoint.php:1526
14811481
#: bp-groups/classes/class-bp-rest-groups-endpoint.php:1434
1482-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1310
1482+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1364
14831483
#: bp-messages/classes/class-bp-rest-messages-endpoint.php:1244
14841484
#: bp-notifications/classes/class-bp-rest-notifications-endpoint.php:894
14851485
msgid "Order sort attribute ascending or descending."
@@ -4425,72 +4425,73 @@ msgstr ""
44254425
msgid "You have been unsubscribed."
44264426
msgstr ""
44274427

4428-
#: bp-core/bp-core-functions.php:4583
4428+
#: bp-core/bp-core-functions.php:4588
44294429
msgid "You can change this or any other email notification preferences in your email settings."
44304430
msgstr ""
44314431

4432-
#: bp-core/bp-core-functions.php:4605
4432+
#: bp-core/bp-core-functions.php:4612
4433+
#: bp-core/bp-core-functions.php:4624
44334434
msgid "Go to website's home page."
44344435
msgstr ""
44354436

4436-
#: bp-core/bp-core-functions.php:5196
4437+
#: bp-core/bp-core-functions.php:5215
44374438
msgid "Discover BuddyPress Add-ons"
44384439
msgstr ""
44394440

4440-
#: bp-core/bp-core-functions.php:5197
4441+
#: bp-core/bp-core-functions.php:5216
44414442
msgid "Hello BuddyPress Add-ons!"
44424443
msgstr ""
44434444

4444-
#: bp-core/bp-core-functions.php:5198
4445+
#: bp-core/bp-core-functions.php:5217
44454446
msgid "Add-ons are features as Plugins or Blocks maintained by the BuddyPress development team & hosted on the WordPress.org plugins directory."
44464447
msgstr ""
44474448

4448-
#: bp-core/bp-core-functions.php:5199
4449+
#: bp-core/bp-core-functions.php:5218
44494450
msgid "Thanks to this new tab inside your Dashboard screen to add plugins, you’ll be able to find them faster and eventually contribute to beta features early to give the BuddyPress development team your feedbacks."
44504451
msgstr ""
44514452

4452-
#: bp-core/bp-core-functions.php:5212
4453-
#: bp-core/bp-core-functions.php:5232
4453+
#: bp-core/bp-core-functions.php:5231
4454+
#: bp-core/bp-core-functions.php:5251
44544455
msgid "Get The BP Classic Add-on"
44554456
msgstr ""
44564457

4457-
#: bp-core/bp-core-functions.php:5213
4458+
#: bp-core/bp-core-functions.php:5232
44584459
msgid "Get ready for the brand-new BP Rewrites API!"
44594460
msgstr ""
44604461

4461-
#: bp-core/bp-core-functions.php:5214
4462+
#: bp-core/bp-core-functions.php:5233
44624463
msgid "Our next major version (12.0.0) will introduce several large changes that could be incompatible with your site's configuration. To prevent problems, we've built the BP Classic Add-on, which you may want to proactively install if any of the following cases:"
44634464
msgstr ""
44644465

4465-
#: bp-core/bp-core-functions.php:5215
4466+
#: bp-core/bp-core-functions.php:5234
44664467
msgid "Some of your BuddyPress plugins have not been updated lately."
44674468
msgstr ""
44684469

4469-
#: bp-core/bp-core-functions.php:5216
4470+
#: bp-core/bp-core-functions.php:5235
44704471
msgid "BuddyPress 12.0.0 introduces the BP Rewrites API, which completely changes the way BuddyPress URLs are built and routed. This fundamental change requires most BuddyPress plugins to update how they deal with BuddyPress URLs. If your BuddyPress plugins have not been updated in the last few months, they are probably not ready for BuddyPress 12.0.0."
44714472
msgstr ""
44724473

4473-
#: bp-core/bp-core-functions.php:5217
4474+
#: bp-core/bp-core-functions.php:5236
44744475
msgid "You are still using the BP Default theme."
44754476
msgstr ""
44764477

4477-
#: bp-core/bp-core-functions.php:5218
4478+
#: bp-core/bp-core-functions.php:5237
44784479
msgid "You still use a BP Legacy Widget."
44794480
msgstr ""
44804481

4481-
#: bp-core/bp-core-functions.php:5219
4482+
#: bp-core/bp-core-functions.php:5238
44824483
msgid "If any of the above items are true, we strongly advise you to install and activate the Classic Add-on before updating to BuddyPress 12.0.0."
44834484
msgstr ""
44844485

4485-
#: bp-core/bp-core-functions.php:5233
4486+
#: bp-core/bp-core-functions.php:5252
44864487
msgid "Thank you for installing BuddyPress 12.0!"
44874488
msgstr ""
44884489

4489-
#: bp-core/bp-core-functions.php:5234
4490+
#: bp-core/bp-core-functions.php:5253
44904491
msgid "BuddyPress 12.0 introduces major core changes, overhauling the way that BuddyPress builds and parses URLs."
44914492
msgstr ""
44924493

4493-
#: bp-core/bp-core-functions.php:5235
4494+
#: bp-core/bp-core-functions.php:5254
44944495
msgid "If you find that your site is not working correctly with the new version, try installing the new BP Classic Add-on that adds backwards compatibility for plugins and themes that have not yet been updated to work with BuddyPress 12.0."
44954496
msgstr ""
44964497

@@ -10257,7 +10258,7 @@ msgid "Identifier for the signup. Can be a signup ID, an email address, or an ac
1025710258
msgstr ""
1025810259

1025910260
#: bp-members/classes/class-bp-rest-signup-endpoint.php:295
10260-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:834
10261+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:845
1026110262
msgid "Invalid signup id."
1026210263
msgstr ""
1026310264

@@ -10283,108 +10284,112 @@ msgstr ""
1028310284
msgid "Fail to activate the signup."
1028410285
msgstr ""
1028510286

10286-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:797
10287+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:768
10288+
msgid "Invalid activation key format."
10289+
msgstr ""
10290+
10291+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:808
1028710292
msgid "Your account has already been activated."
1028810293
msgstr ""
1028910294

10290-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1005
10295+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1059
1029110296
msgid "Passwords cannot be empty or contain the \"\\\" character."
1029210297
msgstr ""
1029310298

10294-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1056
10299+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1110
1029510300
msgid "Password for the new user (never included)."
1029610301
msgstr ""
1029710302

10298-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1064
10303+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1118
1029910304
msgid "The XProfile field data for the new user."
1030010305
msgstr ""
1030110306

10302-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1072
10307+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1126
1030310308
msgid "The XProfile field ID."
1030410309
msgstr ""
1030510310

10306-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1079
10311+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1133
1030710312
#: bp-xprofile/classes/class-bp-rest-xprofile-data-endpoint.php:73
1030810313
msgid "The value(s) (comma separated list of values needs to be used in case of multiple values) for the field data."
1030910314
msgstr ""
1031010315

10311-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1087
10316+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1141
1031210317
msgid "The visibility for the XProfile field."
1031310318
msgstr ""
1031410319

10315-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1145
10320+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1199
1031610321
msgid "A unique numeric ID for the signup."
1031710322
msgstr ""
1031810323

10319-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1151
10324+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1205
1032010325
msgid "The username of the user the signup is for."
1032110326
msgstr ""
1032210327

10323-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1157
10328+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1211
1032410329
msgid "The email for the user the signup is for."
1032510330
msgstr ""
1032610331

10327-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1163
10332+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1217
1032810333
msgid "Activation key of the signup."
1032910334
msgstr ""
1033010335

10331-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1169
10336+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1223
1033210337
msgid "The registered date for the user, in the site's timezone."
1033310338
msgstr ""
1033410339

10335-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1176
10340+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1230
1033610341
msgid "The registered date for the user, as GMT."
1033710342
msgstr ""
1033810343

10339-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1183
10344+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1237
1034010345
msgid "The date the activation email was sent to the user, in the site's timezone."
1034110346
msgstr ""
1034210347

10343-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1190
10348+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1244
1034410349
msgid "The date the activation email was sent to the user, as GMT."
1034510350
msgstr ""
1034610351

10347-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1196
10352+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1250
1034810353
msgid "The number of times the activation email was sent to the user."
1034910354
msgstr ""
1035010355

10351-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1203
10356+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1257
1035210357
msgid "The signup meta information"
1035310358
msgstr ""
1035410359

10355-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1213
10360+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1267
1035610361
msgid "The new user's full name. (Deprecated)"
1035710362
msgstr ""
1035810363

10359-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1222
10364+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1276
1036010365
msgid "Unique site name (slug) of the new user's child site."
1036110366
msgstr ""
1036210367

10363-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1229
10368+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1283
1036410369
msgid "Title of the new user's child site."
1036510370
msgstr ""
1036610371

10367-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1236
10372+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1290
1036810373
msgid "Search engine visibility of the new user's site."
1036910374
msgstr ""
1037010375

10371-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1243
10376+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1297
1037210377
msgid "Language to use for the new user's site."
1037310378
msgstr ""
1037410379

10375-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1276
10380+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1330
1037610381
msgid "Total number of signups to return."
1037710382
msgstr ""
1037810383

10379-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1284
10384+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1338
1038010385
msgid "Offset the result set by a specific number of items."
1038110386
msgstr ""
1038210387

10383-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1301
10388+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1355
1038410389
msgid "Order by a specific parameter (default: signup_id)."
1038510390
msgstr ""
1038610391

10387-
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1319
10392+
#: bp-members/classes/class-bp-rest-signup-endpoint.php:1373
1038810393
msgid "Specific user login to return."
1038910394
msgstr ""
1039010395

0 commit comments

Comments
 (0)