| @@ -1005,8 +1005,14 @@ | ||
| 1005 | 1005 | wpforo_verify_nonce( 'wpforo_post_edit' ); |
| 1006 | 1006 | $r = [ 'html' => '' ]; |
| 1007 | 1007 | if( $postid = wpforo_bigintval( wpfval( $_POST, 'postid' ) ) ) { |
| 1008 | 1008 | if( $post = WPF()->post->get_post( $postid, false ) ) { |
| 1009 | + // forum_can() is a usergroup-level check and takes no post id, so for | |
| 1010 | + // guests it cannot prove ownership of THIS post. Without this gate the | |
| 1011 | + // edit form (post body + a valid form nonce) is handed to any visitor. | |
| 1012 | + if( ! is_user_logged_in() && ! wpforo_guest_owns_post( $postid ) ) { | |
| 1013 | + wp_send_json_error( $r ); | |
| 1014 | + } | |
| 1009 | 1015 | if( WPF()->perm->forum_can( 'eor', $post['forumid'] ) || WPF()->perm->forum_can( |
| 1010 | 1016 | 'eot', |
| 1011 | 1017 | $post['forumid'] |
| 1012 | 1018 | ) ) { |
| @@ -3627,8 +3633,13 @@ | ||
| 3627 | 3633 | |
| 3628 | 3634 | add_action( 'wpforo_after_init', function() { |
| 3629 | 3635 | add_action( 'wp_ajax_dismiss_wpforo_addon_note', [ WPF()->notice, 'dismissAddonNote' ] ); |
| 3630 | 3636 | add_action( 'admin_notices', [ WPF()->notice, 'addonNote' ] ); |
| 3637 | +} ); | |
| 3638 | + | |
| 3639 | +add_action( 'wpforo_after_init', function() { | |
| 3640 | + add_action( 'wp_ajax_wpforo_dismiss_addons_store_promo', [ WPF()->notice, 'dismissAddonsStorePromo' ] ); | |
| 3641 | + add_action( 'admin_notices', [ WPF()->notice, 'addonsStorePromo' ] ); | |
| 3631 | 3642 | } ); |
| 3632 | 3643 | |
| 3633 | 3644 | add_action( 'wpforo_after_init', function() { |
| 3634 | 3645 | add_action( 'wp_ajax_dismiss_wpforo_cache_conflict_note', [ WPF()->notice, 'dismissCacheConflict' ] ); |