Skip to:
Content

bbPress.org

Changeset 5022


Ignore:
Timestamp:
07/10/2013 03:32:43 PM (11 years ago)
Author:
johnjamesjacoby
Message:

Use strict comparisons in bbp_toggle_topic_handler(). See #2358.

File:
1 edited

Legend:

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

    r5021 r5022  
    20572057
    20582058            $is_open = bbp_is_topic_open( $topic_id );
    2059             $success = $is_open ? bbp_close_topic( $topic_id ) : bbp_open_topic( $topic_id );
    2060             $failure = $is_open ? __( '<strong>ERROR</strong>: There was a problem closing the topic.', 'bbpress' ) : __( '<strong>ERROR</strong>: There was a problem opening the topic.', 'bbpress' );
     2059            $success = true === $is_open ? bbp_close_topic( $topic_id ) : bbp_open_topic( $topic_id );
     2060            $failure = true === $is_open ? __( '<strong>ERROR</strong>: There was a problem closing the topic.', 'bbpress' ) : __( '<strong>ERROR</strong>: There was a problem opening the topic.', 'bbpress' );
    20612061
    20622062            break;
     
    20672067
    20682068            $is_sticky = bbp_is_topic_sticky( $topic_id );
    2069             $is_super  = ( empty( $is_sticky ) && !empty( $_GET['super'] ) && "1" === $_GET['super'] ) ? true : false;
    2070             $success   = $is_sticky ? bbp_unstick_topic( $topic_id ) : bbp_stick_topic( $topic_id, $is_super );
    2071             $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' );
     2069            $is_super  = false === $is_sticky && !empty( $_GET['super'] ) && ( "1" === $_GET['super'] ) ? true : false;
     2070            $success   = true  === $is_sticky ? bbp_unstick_topic( $topic_id ) : bbp_stick_topic( $topic_id, $is_super );
     2071            $failure   = true  === $is_sticky ? __( '<strong>ERROR</strong>: There was a problem unsticking the topic.', 'bbpress' ) : __( '<strong>ERROR</strong>: There was a problem sticking the topic.', 'bbpress' );
    20722072
    20732073            break;
     
    20782078
    20792079            $is_spam  = bbp_is_topic_spam( $topic_id );
    2080             $success  = $is_spam ? bbp_unspam_topic( $topic_id ) : bbp_spam_topic( $topic_id );
    2081             $failure  = $is_spam ? __( '<strong>ERROR</strong>: There was a problem unmarking the topic as spam.', 'bbpress' ) : __( '<strong>ERROR</strong>: There was a problem marking the topic as spam.', 'bbpress' );
     2080            $success  = true === $is_spam ? bbp_unspam_topic( $topic_id ) : bbp_spam_topic( $topic_id );
     2081            $failure  = true === $is_spam ? __( '<strong>ERROR</strong>: There was a problem unmarking the topic as spam.', 'bbpress' ) : __( '<strong>ERROR</strong>: There was a problem marking the topic as spam.', 'bbpress' );
    20822082            $view_all = !$is_spam;
    20832083
Note: See TracChangeset for help on using the changeset viewer.