Skip to:
Content

bbPress.org

Changeset 6975


Ignore:
Timestamp:
11/19/2019 09:04:15 PM (7 years ago)
Author:
johnjamesjacoby
Message:

Capabilities: break instead of return.

This commit ensures that the relative _meta_caps filters continue to be executed within their expected contexts.

Previous to this change, certain mapped capability checks would bail out early and return $caps without the ability to filter the results.

With this change, mapped capabilities can now be filtered more logically and inline with the rest of the surrounding logic.

For 2.7, trunk.

Location:
trunk/src/includes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/forums/capabilities.php

    r6783 r6975  
    7070                // Bail if no post ID
    7171                if ( empty( $args[0] ) ) {
    72                     return $caps;
     72                    break;
    7373                }
    7474
     
    115115            // Bail if no post ID
    116116            if ( empty( $args[0] ) ) {
    117                 return $caps;
     117                break;
    118118            }
    119119
     
    163163            // Bail if no post ID
    164164            if ( empty( $args[0] ) ) {
    165                 return $caps;
     165                break;
    166166            }
    167167
     
    200200            // Bail if no post ID
    201201            if ( empty( $args[0] ) ) {
    202                 return $caps;
     202                break;
    203203            }
    204204
  • trunk/src/includes/replies/capabilities.php

    r6921 r6975  
    6060                // Bail if no post ID
    6161                if ( empty( $args[0] ) ) {
    62                     return $caps;
     62                    break;
    6363                }
    6464
     
    133133            // Bail if no post ID
    134134            if ( empty( $args[0] ) ) {
    135                 return $caps;
     135                break;
    136136            }
    137137
     
    181181            // Bail if no post ID
    182182            if ( empty( $args[0] ) ) {
    183                 return $caps;
     183                break;
    184184            }
    185185
  • trunk/src/includes/topics/capabilities.php

    r6921 r6975  
    8080                // Bail if no post ID
    8181                if ( empty( $args[0] ) ) {
    82                     return $caps;
     82                    break;
    8383                }
    8484
     
    153153            // Bail if no post ID
    154154            if ( empty( $args[0] ) ) {
    155                 return $caps;
     155                break;
    156156            }
    157157
     
    201201            // Bail if no post ID
    202202            if ( empty( $args[0] ) ) {
    203                 return $caps;
     203                break;
    204204            }
    205205
Note: See TracChangeset for help on using the changeset viewer.