Changeset 15121
- Timestamp:
- 09/01/2026 07:01:20 PM (2 months ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins
- Files:
-
- 3 edited
-
support-forums/inc/class-directory-compat.php (modified) (1 diff)
-
support-forums/inc/class-support-compat.php (modified) (1 diff)
-
wporg-bbp-topic-resolution/inc/class-plugin.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-directory-compat.php
r15072 r15121 463 463 return $retval; 464 464 } 465 466 // The compat object is loaded from the request, not from $topic_id. 467 $terms = get_the_terms( $topic_id, $this->taxonomy() ); 468 if ( empty( $terms ) || is_wp_error( $terms ) || ! in_array( (string) $this->slug(), wp_list_pluck( $terms, 'slug' ), true ) ) { 469 return $retval; 470 } 471 465 472 if ( 466 473 ( ! empty( $this->authors ) && in_array( $user->user_nicename, $this->authors, true ) ) -
sites/trunk/wordpress.org/public_html/wp-content/plugins/support-forums/inc/class-support-compat.php
r14963 r15121 329 329 */ 330 330 public function is_enabled_on_forum( $retval, $forum_id = 0 ) { 331 // Check the passed forum id.331 // An explicit forum id wins over whatever the request happens to be rendering. 332 332 if ( ! empty( $forum_id ) ) { 333 $retval = ( $forum_id != Plugin::REVIEWS_FORUM_ID);333 return ( Plugin::REVIEWS_FORUM_ID !== (int) $forum_id ); 334 334 } 335 335 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-bbp-topic-resolution/inc/class-plugin.php
r12459 r15121 265 265 */ 266 266 public function topic_resolution_handler( $action = '' ) { 267 if ( ! $this->is_enabled_on_forum() ) {268 return false;269 }270 271 267 // Bail if the action isn't meant for this function. 272 268 if ( $action != 'wporg_bbp_topic_resolution' ) { … … 284 280 $user_id = get_current_user_id(); 285 281 $resolution = $_POST[ self::META_KEY ]; 282 283 // Resolution must be enabled on the topic's forum, not on the one being viewed. 284 if ( $topic && ! $this->is_enabled_on_forum( bbp_get_topic_forum_id( $topic->ID ) ) ) { 285 return false; 286 } 286 287 287 288 // Check for empty topic id. … … 510 511 */ 511 512 public function user_can_resolve( $user_id, $topic_id ) { 512 $post = false; 513 $topic_id = bbp_get_topic_id(); 514 if ( $topic_id ) { 515 $post = get_post( $topic_id ); 516 } 513 // Authorize against the requested topic, only falling back to the displayed one. 514 $topic_id = bbp_get_topic_id( $topic_id ); 515 $post = $topic_id ? bbp_get_topic( $topic_id ) : false; 517 516 518 517 if ( $user_id && $post && ( user_can( $user_id, 'moderate', $topic_id ) || $user_id == $post->post_author ) ) {
Note:
See TracChangeset
for help on using the changeset viewer.