Ticket #3190: 3190-1.diff
File 3190-1.diff, 2.9 KB (added by , 7 years ago) |
---|
-
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 ( ! isset( $args[0] ) || empty( $args[0] ) ) { 61 $caps = array(); 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 ( ! isset( $args[0] ) || empty( $args[0] ) ) { 133 $caps = array(); 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 ( ! isset( $args[0] ) || empty( $args[0] ) ) { 172 $caps = array(); 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 ( ! isset( $args[0] ) || empty( $args[0] ) ) { 81 $caps = array(); 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 ( ! isset( $args[0] ) || empty( $args[0] ) ) { 153 $caps = array(); 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 ( ! isset( $args[0] ) || empty( $args[0] ) ) { 192 $caps = array(); 193 } 194 195 // Get the post. 184 196 $_post = get_post( $args[0] ); 185 197 if ( ! empty( $_post ) ) { 186 198