Skip to:
Content

bbPress.org

Changeset 3808


Ignore:
Timestamp:
03/19/2012 05:17:14 PM (14 years ago)
Author:
johnjamesjacoby
Message:

If there is no topic or reply, bail early out of respective _update_ functions to avoid a ton of errors and bad things from happening.

Location:
branches/plugin/bbp-includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-reply-functions.php

    r3799 r3808  
    614614    $forum_id = bbp_get_forum_id( $forum_id );
    615615
     616    // Bail if there is no reply
     617    if ( empty( $reply_id ) )
     618        return;
     619
    616620    // Check author_id
    617621    if ( empty( $author_id ) )
     
    656660
    657661    // Handle Subscription Checkbox
    658     if ( bbp_is_subscriptions_active() && !empty( $author_id ) ) {
     662    if ( bbp_is_subscriptions_active() && !empty( $author_id ) && !empty( $topic_id ) ) {
    659663        $subscribed = bbp_is_user_subscribed( $author_id, $topic_id );
    660664        $subscheck  = ( !empty( $_POST['bbp_topic_subscription'] ) && ( 'bbp_subscribe' == $_POST['bbp_topic_subscription'] ) ) ? true : false;
  • branches/plugin/bbp-includes/bbp-topic-functions.php

    r3799 r3808  
    717717    $forum_id = bbp_get_forum_id( $forum_id );
    718718
     719    // Bail if there is no topic
     720    if ( empty( $topic_id ) )
     721        return;
     722
    719723    // Check author_id
    720724    if ( empty( $author_id ) )
Note: See TracChangeset for help on using the changeset viewer.