Skip to:
Content

Changeset 11439


Ignore:
Timestamp:
02/22/2017 05:25:40 PM (2 years ago)
Author:
boonebgorges
Message:

Ensure "closed notice" array is an array before treating it like one.

This prevents fatal errors due to illegal string operations in PHP 7.1+.

Ports [11438] to the 2.8 branch.

See #7392.

Location:
branches/2.8
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.8

    • Property svn:mergeinfo changed
      /trunk (added)merged: 11438
  • branches/2.8/src/bp-templates/bp-legacy/buddypress-functions.php

    r11421 r11439  
    15281528
    15291529    } else {
    1530         $user_id      = get_current_user_id();
    1531         $notice_ids   = bp_get_user_meta( $user_id, 'closed_notices', true );
     1530        $user_id    = get_current_user_id();
     1531        $notice_ids = bp_get_user_meta( $user_id, 'closed_notices', true );
     1532        if ( ! is_array( $notice_ids ) ) {
     1533            $notice_ids = array();
     1534        }
     1535
    15321536        $notice_ids[] = (int) $_POST['notice_id'];
    15331537
Note: See TracChangeset for help on using the changeset viewer.