Skip to:
Content

bbPress.org


Ignore:
Timestamp:
12/12/2016 01:59:44 PM (8 years ago)
Author:
xknown
Message:

Branch 0.9: Fix PHP 7 compat issues w.r.t. the use of func_get_arg() and PHP 5.x constructors.

  • func_get_arg() returns the current (modified) value of the given argument. Let's make sure the code behaves the same.
  • Add PHP 5.x style constructors.
  • Use preg_match instead of eregi

See #3033

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/0.9/bb-includes/capabilities.php

    r1173 r6160  
    88    var $role_key;
    99
    10     function BB_Roles() {
     10    function __construct() {
    1111        global $bbdb;
    1212        $this->role_key = $bbdb->prefix . 'user_roles';
     
    2121            $this->role_names[$role] = $this->roles[$role]['name'];
    2222        }
     23    }
     24
     25    function BB_Roles() {
     26        $this->__construct();
    2327    }
    2428
     
    214218    var $capabilities;
    215219
    216     function BB_Role($role, $capabilities) {
     220    function __construct($role, $capabilities) {
    217221        $this->name = $role;
    218222        $this->capabilities = $capabilities;
     223    }
     224
     225    function BB_Role($role, $capabilities) {
     226        $this->__construct($role, $capabilities);
    219227    }
    220228
     
    251259    var $allcaps = array();
    252260
    253     function BB_User($id) {
     261    function __construct($id) {
    254262        global $bb_roles, $bbdb;
    255263
     
    268276        }
    269277        $this->get_role_caps();
     278    }
     279
     280    function BB_User($id) {
     281        $this->__construct($id);
    270282    }
    271283
Note: See TracChangeset for help on using the changeset viewer.