PluginProbe
wpForo Forum / 3.1.6
wpForo Forum v3.1.6
3.1.6 3.1.5 3.1.4 3.1.2 3.1.1 3.1.0 3.0.9 3.0.8 3.0.7 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 All 138 releases
← All changes | includes/hooks.php +6 -0 3.1.53.1.6 View file →
@@ -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 ) ) {