Make WordPress Core

Changeset 13770


Ignore:
Timestamp:
03/19/2010 09:29:21 PM (14 years ago)
Author:
nacin
Message:

Remove redundant isset() and empty() checks.

Location:
trunk
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-comments.php

    r13247 r13770  
    9696    wp_redirect( $redirect_to );
    9797    exit;
    98 } elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) {
     98} elseif ( ! empty($_GET['_wp_http_referer']) ) {
    9999     wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
    100100     exit;
     
    108108require_once('admin-header.php');
    109109
    110 $mode = ( ! isset($_GET['mode']) || empty($_GET['mode']) ) ? 'detail' : esc_attr($_GET['mode']);
     110$mode = ( empty($_GET['mode']) ) ? 'detail' : esc_attr($_GET['mode']);
    111111
    112112$comment_status = isset($_REQUEST['comment_status']) ? $_REQUEST['comment_status'] : 'all';
  • trunk/wp-admin/edit-link-categories.php

    r13715 r13770  
    4141        exit();
    4242    }
    43 } elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) {
     43} elseif ( ! empty($_GET['_wp_http_referer']) ) {
    4444     wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
    4545     exit;
  • trunk/wp-admin/edit-tags.php

    r13733 r13770  
    156156default:
    157157
    158 if ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) {
     158if ( ! empty($_GET['_wp_http_referer']) ) {
    159159     wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
    160160     exit;
  • trunk/wp-admin/edit.php

    r13643 r13770  
    133133    wp_redirect($sendback);
    134134    exit();
    135 } elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) {
     135} elseif ( ! empty($_GET['_wp_http_referer']) ) {
    136136     wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
    137137     exit;
  • trunk/wp-admin/includes/class-wp-filesystem-ftpext.php

    r13380 r13770  
    4646            $this->options['hostname'] = $opt['hostname'];
    4747
    48         if ( isset($opt['base']) && ! empty($opt['base']) )
     48        if ( ! empty($opt['base']) )
    4949            $this->wp_base = $opt['base'];
    5050
  • trunk/wp-admin/includes/class-wp-filesystem-ftpsockets.php

    r12999 r13770  
    4040            $this->options['hostname'] = $opt['hostname'];
    4141
    42         if ( isset($opt['base']) && ! empty($opt['base']) )
     42        if ( ! empty($opt['base']) )
    4343            $this->wp_base = $opt['base'];
    4444
  • trunk/wp-admin/includes/class-wp-filesystem-ssh2.php

    r12752 r13770  
    7474            $this->options['hostname'] = $opt['hostname'];
    7575
    76         if ( isset($opt['base']) && ! empty($opt['base']) )
     76        if ( ! empty($opt['base']) )
    7777            $this->wp_base = $opt['base'];
    7878
  • trunk/wp-admin/includes/plugin.php

    r13769 r13770  
    12441244    global $plugin_page;
    12451245
    1246     if ( isset( $title ) && !empty ( $title ) ) {
     1246    if ( ! empty ( $title ) )
    12471247        return $title;
    1248     }
    12491248
    12501249    $hook = get_plugin_page_hook( $plugin_page, $pagenow );
     
    12911290            }
    12921291        }
    1293         if ( !isset($title) || empty ( $title ) ) {
     1292        if ( empty ( $title ) ) {
    12941293            foreach ( $menu as $menu_array ) {
    12951294                if ( isset( $plugin_page ) &&
  • trunk/wp-admin/install.php

    r13769 r13770  
    8080    // Ensure that Blogs appear in search engines by default
    8181    $blog_public = 1;
    82     if ( isset( $_POST ) && ! empty( $_POST ) )
     82    if ( ! empty( $_POST ) )
    8383        $blog_public = isset( $_POST['blog_public'] );
    8484
  • trunk/wp-admin/link-manager.php

    r13100 r13770  
    2929        exit;
    3030    }
    31 } elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) {
     31} elseif ( ! empty($_GET['_wp_http_referer']) ) {
    3232     wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
    3333     exit;
  • trunk/wp-admin/menu-header.php

    r13579 r13770  
    5555        }
    5656
    57         if ( isset($item[4]) && ! empty($item[4]) )
     57        if ( ! empty($item[4]) )
    5858            $class[] = $item[4];
    5959
    6060        $class = $class ? ' class="' . join( ' ', $class ) . '"' : '';
    6161        $tabindex = ' tabindex="1"';
    62         $id = isset($item[5]) && ! empty($item[5]) ? ' id="' . preg_replace( '|[^a-zA-Z0-9_:.]|', '-', $item[5] ) . '"' : '';
     62        $id = ! empty($item[5]) ? ' id="' . preg_replace( '|[^a-zA-Z0-9_:.]|', '-', $item[5] ) . '"' : '';
    6363        $img = '';
    64         if ( isset($item[6]) && ! empty($item[6]) ) {
     64        if ( ! empty($item[6]) ) {
    6565            if ( 'div' === $item[6] )
    6666                $img = '<br />';
  • trunk/wp-admin/upload.php

    r13733 r13770  
    118118    wp_redirect($location);
    119119    exit;
    120 } elseif ( isset($_GET['_wp_http_referer']) && ! empty($_GET['_wp_http_referer']) ) {
     120} elseif ( ! empty($_GET['_wp_http_referer']) ) {
    121121     wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), stripslashes($_SERVER['REQUEST_URI']) ) );
    122122     exit;
  • trunk/wp-content/themes/default/archive.php

    r12180 r13770  
    2525      <?php /* If this is an author archive */ } elseif (is_author()) { ?>
    2626        <h2 class="pagetitle">Author Archive</h2>
    27       <?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
     27      <?php /* If this is a paged archive */ } elseif ( !empty($_GET['paged']) ) { ?>
    2828        <h2 class="pagetitle">Blog Archives</h2>
    2929      <?php } ?>
  • trunk/wp-content/themes/default/sidebar.php

    r12657 r13770  
    4343            for <strong>'<?php the_search_query(); ?>'</strong>. If you are unable to find anything in these search results, you can try one of these links.</p>
    4444
    45             <?php /* If this set is paginated */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
     45            <?php /* If this set is paginated */ } elseif ( !empty($_GET['paged']) ) { ?>
    4646            <p>You are currently browsing the <a href="<?php bloginfo('url'); ?>/"><?php bloginfo('name'); ?></a> blog archives.</p>
    4747
  • trunk/wp-includes/kses.php

    r13648 r13770  
    952952
    953953    if ( is_array($matches) ) {
    954         if ( ! isset($matches[1]) || empty($matches[1]) )
     954        if ( empty($matches[1]) )
    955955            return '';
    956956
  • trunk/wp-includes/load.php

    r13599 r13770  
    6363
    6464            // Append the query string if it exists and isn't null
    65             if ( isset( $_SERVER['QUERY_STRING'] ) && !empty( $_SERVER['QUERY_STRING'] ) ) {
     65            if ( ! empty( $_SERVER['QUERY_STRING'] ) ) {
    6666                $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING'];
    6767            }
  • trunk/wp-includes/post-template.php

    r13494 r13770  
    829829
    830830    // Show Home in the menu
    831     if ( isset($args['show_home']) && ! empty($args['show_home']) ) {
     831    if ( ! empty($args['show_home']) ) {
    832832        if ( true === $args['show_home'] || '1' === $args['show_home'] || 1 === $args['show_home'] )
    833833            $text = __('Home');
  • trunk/wp-includes/post.php

    r13733 r13770  
    20792079    // Create a valid post name.  Drafts and pending posts are allowed to have an empty
    20802080    // post name.
    2081     if ( !isset($post_name) || empty($post_name) ) {
     2081    if ( empty($post_name) ) {
    20822082        if ( !in_array( $post_status, array( 'draft', 'pending', 'auto-draft' ) ) )
    20832083            $post_name = sanitize_title($post_title);
  • trunk/wp-includes/query.php

    r13758 r13770  
    22352235            $where .= $wpdb->prepare(" AND $wpdb->postmeta.meta_key = %s ", $q['meta_key']);
    22362236        if ( ! empty($q['meta_value']) ) {
    2237             if ( ! isset($q['meta_compare']) || empty($q['meta_compare']) || ! in_array($q['meta_compare'], array('=', '!=', '>', '>=', '<', '<=')) )
     2237            if ( empty($q['meta_compare']) || ! in_array($q['meta_compare'], array('=', '!=', '>', '>=', '<', '<=')) )
    22382238                $q['meta_compare'] = '=';
    22392239
  • trunk/wp-includes/widgets.php

    r13701 r13770  
    967967    $index = ( is_int($index) ) ? "sidebar-$index" : sanitize_title($index);
    968968    $sidebars_widgets = wp_get_sidebars_widgets();
    969     if ( isset($sidebars_widgets[$index]) && !empty($sidebars_widgets[$index]) )
     969    if ( !empty($sidebars_widgets[$index]) )
    970970        return true;
    971971
Note: See TracChangeset for help on using the changeset viewer.