Ticket #3190: 3190-2.diff
File 3190-2.diff, 3.9 KB (added by , 7 years ago) |
---|
-
src/includes/forums/capabilities.php
67 67 // Do some post ID based logic 68 68 } else { 69 69 70 // Get the post 70 if ( empty( $args[0] ) ) { 71 return $caps; 72 } 73 74 // Get the post. 71 75 $_post = get_post( $args[0] ); 72 76 if ( ! empty( $_post ) ) { 73 77 … … 107 111 108 112 case 'moderate_forum' : 109 113 110 // Get the post 114 if ( empty( $args[0] ) ) { 115 return $caps; 116 } 117 118 // Get the post. 111 119 $_post = get_post( $args[0] ); 112 120 if ( ! empty( $_post ) && bbp_allow_forum_mods() ) { 113 121 … … 150 158 // Used everywhere 151 159 case 'edit_forum' : 152 160 153 // Get the post 161 if ( empty( $args[0] ) ) { 162 return $caps; 163 } 164 165 // Get the post. 154 166 $_post = get_post( $args[0] ); 155 167 if ( ! empty( $_post ) ) { 156 168 … … 182 194 // Allow forum authors to delete forums (for BuddyPress groups, etc) 183 195 case 'delete_forum' : 184 196 185 // Get the post 197 if ( empty( $args[0] ) ) { 198 return $caps; 199 } 200 201 // Get the post. 186 202 $_post = get_post( $args[0] ); 187 203 if ( ! empty( $_post ) ) { 188 204 -
src/includes/replies/capabilities.php
34 34 * 35 35 * @since 2.2.0 bbPress (r4242) 36 36 * 37 * @param array $caps Capabilities for meta capability38 * @param string $cap Capability name39 * @param int $user_id User id40 * @param array $args Arguments37 * @param array $caps Capabilities for meta capability. 38 * @param string $cap Capability name. 39 * @param int $user_id User id. 40 * @param array $args Arguments. 41 41 * 42 42 * @return array Actual capabilities for meta capability 43 43 */ … … 57 57 // Do some post ID based logic 58 58 } else { 59 59 60 // Get the post 60 if ( empty( $args[0] ) ) { 61 return $caps; 62 } 63 64 // Get the post. 61 65 $_post = get_post( $args[0] ); 62 66 if ( ! empty( $_post ) ) { 63 67 … … 125 129 // Used everywhere 126 130 case 'edit_reply' : 127 131 128 // Get the post 132 if ( empty( $args[0] ) ) { 133 return $caps; 134 } 135 136 // Get the post. 129 137 $_post = get_post( $args[0] ); 130 138 if ( ! empty( $_post ) ) { 131 139 … … 160 168 161 169 case 'delete_reply' : 162 170 171 if ( empty( $args[0] ) ) { 172 return $caps; 173 } 174 163 175 // Get the post 164 176 $_post = get_post( $args[0] ); 165 177 if ( ! empty( $_post ) ) { -
src/includes/topics/capabilities.php
54 54 * 55 55 * @since 2.2.0 bbPress (r4242) 56 56 * 57 * @param array $caps Capabilities for meta capability58 * @param string $cap Capability name59 * @param int $user_id User id60 * @param array $args Arguments57 * @param array $caps Capabilities for meta capability. 58 * @param string $cap Capability name. 59 * @param int $user_id User id. 60 * @param array $args Arguments. 61 61 * 62 62 * @return array Actual capabilities for meta capability 63 63 */ … … 77 77 // Do some post ID based logic 78 78 } else { 79 79 80 // Get the post 80 if ( empty( $args[0] ) ) { 81 return $caps; 82 } 83 84 // Get the post. 81 85 $_post = get_post( $args[0] ); 82 86 if ( ! empty( $_post ) ) { 83 87 … … 145 149 // Used everywhere 146 150 case 'edit_topic' : 147 151 148 // Get the post 152 if ( empty( $args[0] ) ) { 153 return $caps; 154 } 155 156 // Get the post. 149 157 $_post = get_post( $args[0] ); 150 158 if ( ! empty( $_post ) ) { 151 159 … … 180 188 181 189 case 'delete_topic' : 182 190 183 // Get the post 191 if ( empty( $args[0] ) ) { 192 return $caps; 193 } 194 195 // Get the post. 184 196 $_post = get_post( $args[0] ); 185 197 if ( ! empty( $_post ) ) { 186 198