Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/25/2014 05:17:36 PM (5 years ago)
Author:
r-a-y
Message:

Activity: Make sure a non-admin can delete their own activity.

Changes in r8697 broke this functionality due to a strict type check. The
activity user ID is a string, while the logged-in user is an integer.

Commit fixes this by typecasting the activity user ID as an integer and
adds a unit test.

Fixes #5900 (trunk).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-activity/bp-activity-template.php

    r8975 r9043  
    16951695        // quite powerful, because doing so also deletes all comments to that
    16961696        // activity item. We should revisit this eventually.
    1697         if ( isset( $activity->user_id ) && ( $activity->user_id === bp_loggedin_user_id() ) ) {
     1697        if ( isset( $activity->user_id ) && ( (int) $activity->user_id === bp_loggedin_user_id() ) ) {
    16981698            $can_delete = true;
    16991699        }
Note: See TracChangeset for help on using the changeset viewer.