Changeset 5294
- Timestamp:
- 04/09/2017 06:00:28 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-moderators.php
r5293 r5294 152 152 153 153 public function archive_handler( $action = '' ) { 154 if ( ! current_user_can( 'moderate' ) ) {155 return;156 }157 $user_id = get_current_user_id();158 159 154 if ( ! in_array( $action, $this->get_valid_actions() ) ) { 160 155 return; … … 165 160 } 166 161 167 $post = get_post( absint( $_GET['post_id'] ) ); 168 if ( ! $post ) { 169 return false; 162 $user_id = get_current_user_id(); 163 $post_id = absint( $_GET['post_id'] ); 164 165 $post = get_post( $post_id ); 166 if ( ! $post ) { 167 return; 168 } 169 170 if ( ! current_user_can( 'moderate', $post->ID ) ) { 171 return; 170 172 } 171 173 … … 229 231 230 232 public function get_archive_link( $args = array() ) { 231 if ( ! current_user_can( 'moderate' ) ) {232 return false;233 }234 $user_id = get_current_user_id();235 236 233 $r = bbp_parse_args( $args, array( 237 234 'post_id' => get_the_ID(), … … 239 236 'unarchive' => esc_html__( 'Unarchive', 'wporg-forums' ), 240 237 ), 'get_post_archive_link' ); 238 241 239 if ( empty( $r['post_id'] ) ) { 242 240 return false; 243 241 } 242 243 $user_id = get_current_user_id(); 244 244 $post_id = $r['post_id']; 245 245 246 246 $post = get_post( $post_id ); 247 247 if ( ! $post ) { 248 return false; 249 } 250 251 if ( ! current_user_can( 'moderate', $post->ID ) ) { 248 252 return false; 249 253 }
Note: See TracChangeset
for help on using the changeset viewer.