Skip to:
Content
Pages
Categories
Search
Top
Bottom

Possible issue untrashing topics


  • slayne76
    Participant

    @slayne76

    Hi,
    I run a couple of different bbpress installations, of course they’re both up-to-date (2.5.4)

    I noticed that on both installations, when you trash a topic, and you try to “un-trashit” you receive a nonce error.

    I’m not sure if this issue depends on my personal configuration, but of course i disabled all other plugins and used a fresh wp install.

    Being a PHP developer I digged inside the core files of bbpress and I noticed that in includes/topics.php on line 818 the nonce is generated with

    wp_nonce_url( add_query_arg( array( '_wp_http_referer' => add_query_arg( array( 'post_type' => bbp_get_topic_post_type() ), admin_url( 'edit.php' ) ) ), admin_url( sprintf( $post_type_object->_edit_link . '&action=untrash', $topic->ID ) ) ), 'untrash-' . $topic->post_type . '_' . $topic->ID )

    so the “sent” nonce is basically untrash-topic_<ID>, while the nonce check on wordpress (on post.php line 265 is:

    check_admin_referer('untrash-post_' . $post_id);

    or basically untrash-post_<ID>.

    Can anyone tell me if other people found out a similar issue untrashing topics or is it just me? Thanks in advance for your support :)

Viewing 3 replies - 1 through 3 (of 3 total)

  • Stephen Edgar
    Moderator

    @netweb

    I haven’t looked at what you have above closely, nor have I looked closely at the changes @jjj made recently but we just changed some of the logic behind trash, untrash, spam and unspam for topics and replies.

    Details and links to changesets are in the following ticket if you want to take a look as it appears I have not really looked at anything ;)

    https://bbpress.trac.wordpress.org/ticket/2494

    If you don’t see anything in that ticket or related to what your looking for please create a new ticket and I promise I will look ;)


    slayne76
    Participant

    @slayne76

    Hi Stephen,
    thanks for the reply. I looked at the trac but it’s not strictly related, since it refers to the spam/trash/admin links on the front end.
    What I noticed instead, (and you can test yourself and let me know) is simply as this: in the backend (wordpress admin area) when a topic is in the trashcan, and you click untrash (the same thing you would do with posts, pages, custom post types when you put the in the trashcan) you get the default nonce wordpress error. You simply “CAN’T” untrash something directly inside wordpress.
    I was hoping that anyone else could try the same and give me confirmation that the issue exists (in the code i posted I was able to indentify the problem as well)

    If you, or anyone else, can confirm there is this issue, I (or you, or whoever wants to) can open a ticket in the trac so it gets fixed asap :)


    Stephen Edgar
    Moderator

    @netweb

    Indeed I can confirm this is happening, feel free to create a ticket and if you have a patch add that also https://bbpress.trac.wordpress.org/, if not I’ll try to get some time later in the week to have a look.

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.