Skip to:
Content

bbPress.org

Changeset 5021


Ignore:
Timestamp:
07/10/2013 03:29:03 PM (12 years ago)
Author:
johnjamesjacoby
Message:

Use string values when comparing against super globals. Regression introduced in r4995. See #2358.

Location:
trunk/includes
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/admin/topics.php

    r4995 r5021  
    502502
    503503                    $is_sticky = bbp_is_topic_sticky( $topic_id );
    504                     $is_super  = ( empty( $is_sticky ) && !empty( $_GET['super'] ) && 1 === (int) $_GET['super'] ) ? true : false;
    505                     $message   = true === $is_sticky ? 'unsticked'     : 'sticked';
    506                     $message   = true === $is_super  ? 'super_sticked' : $message;
    507                     $success   = true === $is_sticky ? bbp_unstick_topic( $topic_id ) : bbp_stick_topic( $topic_id, $is_super );
     504                    $is_super  = false === $is_sticky && !empty( $_GET['super'] ) && ( "1" === $_GET['super'] ) ? true : false;
     505                    $message   = true  === $is_sticky ? 'unsticked'     : 'sticked';
     506                    $message   = true  === $is_super  ? 'super_sticked' : $message;
     507                    $success   = true  === $is_sticky ? bbp_unstick_topic( $topic_id ) : bbp_stick_topic( $topic_id, $is_super );
    508508
    509509                    break;
  • trunk/includes/forums/functions.php

    r5017 r5021  
    509509
    510510    // Update revision log
    511     if ( !empty( $_POST['bbp_log_forum_edit'] ) && ( 1 === $_POST['bbp_log_forum_edit'] ) && ( $revision_id = wp_save_post_revision( $forum_id ) ) ) {
     511    if ( !empty( $_POST['bbp_log_forum_edit'] ) && ( "1" === $_POST['bbp_log_forum_edit'] ) && ( $revision_id = wp_save_post_revision( $forum_id ) ) ) {
    512512        bbp_update_forum_revision_log( array(
    513513            'forum_id'    => $forum_id,
  • trunk/includes/replies/functions.php

    r5009 r5021  
    713713
    714714    // Update revision log
    715     if ( !empty( $_POST['bbp_log_reply_edit'] ) && ( 1 === $_POST['bbp_log_reply_edit'] ) ) {
     715    if ( !empty( $_POST['bbp_log_reply_edit'] ) && ( "1" === $_POST['bbp_log_reply_edit'] ) ) {
    716716        $revision_id = wp_save_post_revision( $reply_id );
    717717        if ( !empty( $revision_id ) ) {
  • trunk/includes/topics/functions.php

    r5019 r5021  
    690690
    691691        // Update revision log
    692         if ( !empty( $_POST['bbp_log_topic_edit'] ) && ( 1 === $_POST['bbp_log_topic_edit'] ) )  {
     692        if ( !empty( $_POST['bbp_log_topic_edit'] ) && ( "1" === $_POST['bbp_log_topic_edit'] ) )  {
    693693            $revision_id = wp_save_post_revision( $topic_id );
    694694            if ( ! empty( $revision_id ) ) {
     
    12111211
    12121212            // Shift the subscriber if told to
    1213             if ( !empty( $_POST['bbp_topic_subscribers'] ) && ( 1 === $_POST['bbp_topic_subscribers'] ) && bbp_is_subscriptions_active() )
     1213            if ( !empty( $_POST['bbp_topic_subscribers'] ) && ( "1" === $_POST['bbp_topic_subscribers'] ) && bbp_is_subscriptions_active() )
    12141214                bbp_add_user_subscription( $subscriber, $destination_topic->ID );
    12151215
     
    12311231
    12321232            // Shift the favoriter if told to
    1233             if ( !empty( $_POST['bbp_topic_favoriters'] ) && 1 === $_POST['bbp_topic_favoriters'] )
     1233            if ( !empty( $_POST['bbp_topic_favoriters'] ) && "1" === $_POST['bbp_topic_favoriters'] )
    12341234                bbp_add_user_favorite( $favoriter, $destination_topic->ID );
    12351235
     
    12481248
    12491249        // Shift the tags if told to
    1250         if ( !empty( $_POST['bbp_topic_tags'] ) && ( 1 === $_POST['bbp_topic_tags'] ) )
     1250        if ( !empty( $_POST['bbp_topic_tags'] ) && ( "1" === $_POST['bbp_topic_tags'] ) )
    12511251            wp_set_post_terms( $destination_topic->ID, $source_topic_tags, bbp_get_topic_tag_tax_id(), true );
    12521252
     
    15621562
    15631563    // Copy the subscribers
    1564     if ( !empty( $_POST['bbp_topic_subscribers'] ) && 1 === $_POST['bbp_topic_subscribers'] && bbp_is_subscriptions_active() ) {
     1564    if ( !empty( $_POST['bbp_topic_subscribers'] ) && "1" === $_POST['bbp_topic_subscribers'] && bbp_is_subscriptions_active() ) {
    15651565
    15661566        // Get the subscribers
     
    15791579
    15801580    // Copy the favoriters if told to
    1581     if ( !empty( $_POST['bbp_topic_favoriters'] ) && 1 === $_POST['bbp_topic_favoriters'] ) {
     1581    if ( !empty( $_POST['bbp_topic_favoriters'] ) && ( "1" === $_POST['bbp_topic_favoriters'] ) ) {
    15821582
    15831583        // Get the favoriters
     
    15961596
    15971597    // Copy the tags if told to
    1598     if ( !empty( $_POST['bbp_topic_tags'] ) && ( 1 === $_POST['bbp_topic_tags'] ) ) {
     1598    if ( !empty( $_POST['bbp_topic_tags'] ) && ( "1" === $_POST['bbp_topic_tags'] ) ) {
    15991599
    16001600        // Get the source topic tags
     
    20672067
    20682068            $is_sticky = bbp_is_topic_sticky( $topic_id );
    2069             $is_super  = ( empty( $is_sticky ) && !empty( $_GET['super'] ) && 1 === (int) $_GET['super'] ) ? true : false;
     2069            $is_super  = ( empty( $is_sticky ) && !empty( $_GET['super'] ) && "1" === $_GET['super'] ) ? true : false;
    20702070            $success   = $is_sticky ? bbp_unstick_topic( $topic_id ) : bbp_stick_topic( $topic_id, $is_super );
    20712071            $failure   = $is_sticky ? __( '<strong>ERROR</strong>: There was a problem unsticking the topic.', 'bbpress' ) : __( '<strong>ERROR</strong>: There was a problem sticking the topic.', 'bbpress' );
Note: See TracChangeset for help on using the changeset viewer.