Ticket #30799: 30799.2.diff
File 30799.2.diff, 53.4 KB (added by , 10 years ago) |
---|
-
src/wp-admin/admin.php
167 167 } 168 168 169 169 $hook_suffix = ''; 170 if ( isset( $page_hook) )170 if ( isset( $page_hook ) ) { 171 171 $hook_suffix = $page_hook; 172 else if ( isset($plugin_page) ) 172 } elseif ( isset( $plugin_page ) ) { 173 173 $hook_suffix = $plugin_page; 174 else if ( isset($pagenow) ) 174 } elseif ( isset( $pagenow ) ) { 175 175 $hook_suffix = $pagenow; 176 } 176 177 177 178 set_current_screen(); 178 179 … … 243 244 include(ABSPATH . 'wp-admin/admin-footer.php'); 244 245 245 246 exit(); 246 } else if (isset($_GET['import'])) {247 } elseif ( isset( $_GET['import'] ) ) { 247 248 248 249 $importer = $_GET['import']; 249 250 -
src/wp-admin/edit-tags.php
28 28 if ( 'post' != $post_type ) { 29 29 $parent_file = ( 'attachment' == $post_type ) ? 'upload.php' : "edit.php?post_type=$post_type"; 30 30 $submenu_file = "edit-tags.php?taxonomy=$taxonomy&post_type=$post_type"; 31 } else 31 } elseif ( 'link_category' == $tax->name ) { 32 32 $parent_file = 'link-manager.php'; 33 33 $submenu_file = 'edit-tags.php?taxonomy=link_category'; 34 34 } else { -
src/wp-admin/export.php
60 60 61 61 if ( ! isset( $_GET['content'] ) || 'all' == $_GET['content'] ) { 62 62 $args['content'] = 'all'; 63 } else 63 } elseif ( 'posts' == $_GET['content'] ) { 64 64 $args['content'] = 'post'; 65 65 66 66 if ( $_GET['cat'] ) … … 76 76 77 77 if ( $_GET['post_status'] ) 78 78 $args['status'] = $_GET['post_status']; 79 } else 79 } elseif ( 'pages' == $_GET['content'] ) { 80 80 $args['content'] = 'page'; 81 81 82 82 if ( $_GET['page_author'] ) -
src/wp-admin/includes/ajax-actions.php
422 422 continue; 423 423 if ( !$cat_id = term_exists( $cat_name, $taxonomy->name, $parent ) ) 424 424 $cat_id = wp_insert_term( $cat_name, $taxonomy->name, array( 'parent' => $parent ) ); 425 if ( is_wp_error( $cat_id ) ) 425 if ( is_wp_error( $cat_id ) ) { 426 426 continue; 427 else if ( is_array( $cat_id ) )427 } elseif ( is_array( $cat_id ) ) { 428 428 $cat_id = $cat_id['term_id']; 429 } 429 430 $checked_categories[] = $cat_id; 430 431 if ( $parent ) // Do these all at once in a second 431 432 continue; … … 741 742 continue; 742 743 if ( !$cat_id = term_exists( $cat_name, 'link_category' ) ) 743 744 $cat_id = wp_insert_term( $cat_name, 'link_category' ); 744 if ( is_wp_error( $cat_id ) ) 745 if ( is_wp_error( $cat_id ) ) { 745 746 continue; 746 else if ( is_array( $cat_id ) )747 } elseif ( is_array( $cat_id ) ) { 747 748 $cat_id = $cat_id['term_id']; 749 } 748 750 $cat_name = esc_html( $cat_name ); 749 751 $x->add( array( 750 752 'what' => 'link-category', … … 1174 1176 } else { 1175 1177 wp_die( 0 ); 1176 1178 } 1177 } else if ( !$mid = add_meta( $pid ) ) {1179 } elseif ( ! $mid = add_meta( $pid ) ) { 1178 1180 wp_die( __( 'Please provide a custom field value.' ) ); 1179 1181 } 1180 1182 -
src/wp-admin/includes/class-wp-comments-list-table.php
447 447 448 448 // Not looking at all comments. 449 449 if ( $comment_status && 'all' != $comment_status ) { 450 if ( 'approved' == $the_comment_status ) 450 if ( 'approved' == $the_comment_status ) { 451 451 $actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=unapproved' class='vim-u vim-destructive' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>'; 452 else if ( 'unapproved' == $the_comment_status )452 } elseif ( 'unapproved' == $the_comment_status ) { 453 453 $actions['approve'] = "<a href='$approve_url' data-wp-lists='delete:the-comment-list:comment-$comment->comment_ID:e7e7d3:action=dim-comment&new=approved' class='vim-a vim-destructive' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>'; 454 } 454 455 } else { 455 456 $actions['approve'] = "<a href='$approve_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=approved' class='vim-a' title='" . esc_attr__( 'Approve this comment' ) . "'>" . __( 'Approve' ) . '</a>'; 456 457 $actions['unapprove'] = "<a href='$unapprove_url' data-wp-lists='dim:the-comment-list:comment-$comment->comment_ID:unapproved:e7e7d3:e7e7d3:new=unapproved' class='vim-u' title='" . esc_attr__( 'Unapprove this comment' ) . "'>" . __( 'Unapprove' ) . '</a>'; -
src/wp-admin/includes/class-wp-importer.php
273 273 } 274 274 275 275 $last_arg = $key; 276 } else 276 } elseif ( (bool) preg_match( "/^-([a-zA-Z0-9]+)/", $args[$i], $match ) ) { 277 277 for ( $j = 0, $jl = strlen( $match[1] ); $j < $jl; $j++ ) { 278 278 $key = $match[1]{$j}; 279 279 $out[$key] = true; … … 280 280 } 281 281 282 282 $last_arg = $key; 283 } else 283 } elseif ( $last_arg !== null ) { 284 284 $out[$last_arg] = $args[$i]; 285 285 } 286 286 } -
src/wp-admin/includes/class-wp-upgrader-skins.php
447 447 unset( $install_actions['activate_plugin'] ); 448 448 } 449 449 450 if ( 'import' == $from ) 450 if ( 'import' == $from ) { 451 451 $install_actions['importers_page'] = '<a href="' . admin_url('import.php') . '" title="' . esc_attr__('Return to Importers') . '" target="_parent">' . __('Return to Importers') . '</a>'; 452 else if ( $this->type == 'web' )452 } elseif ( $this->type == 'web' ) { 453 453 $install_actions['plugins_page'] = '<a href="' . self_admin_url('plugin-install.php') . '" title="' . esc_attr__('Return to Plugin Installer') . '" target="_parent">' . __('Return to Plugin Installer') . '</a>'; 454 else454 } else { 455 455 $install_actions['plugins_page'] = '<a href="' . self_admin_url('plugins.php') . '" title="' . esc_attr__('Return to Plugins page') . '" target="_parent">' . __('Return to Plugins page') . '</a>'; 456 } 456 457 457 458 if ( ! $this->result || is_wp_error($this->result) ) { 458 459 unset( $install_actions['activate_plugin'], $install_actions['network_activate'] ); … … 731 732 * @param string|array|WP_Error $data 732 733 */ 733 734 public function feedback( $data ) { 734 if ( is_wp_error( $data ) ) 735 if ( is_wp_error( $data ) ) { 735 736 $string = $data->get_error_message(); 736 else if ( is_array( $data ) )737 } elseif ( is_array( $data ) ) { 737 738 return; 738 else739 } else { 739 740 $string = $data; 740 741 } 741 742 if ( ! empty( $this->upgrader->strings[ $string ] ) ) 742 743 $string = $this->upgrader->strings[ $string ]; 743 744 -
src/wp-admin/includes/class-wp-upgrader.php
431 431 432 432 if ( is_wp_error($removed) ) { 433 433 return $removed; 434 } else 434 } elseif ( ! $removed ) { 435 435 return new WP_Error('remove_old_failed', $this->strings['remove_old_failed']); 436 436 } 437 437 } elseif ( $args['abort_if_destination_exists'] && $wp_filesystem->exists($remote_destination) ) { … … 637 637 $maintenance_string = '<?php $upgrading = ' . time() . '; ?>'; 638 638 $wp_filesystem->delete($file); 639 639 $wp_filesystem->put_contents($file, $maintenance_string, FS_CHMOD_FILE); 640 } else if ( !$enable && $wp_filesystem->exists($file) ) {640 } elseif ( ! $enable && $wp_filesystem->exists( $file ) ) { 641 641 $this->skin->feedback('maintenance_end'); 642 642 $wp_filesystem->delete($file); 643 643 } -
src/wp-admin/includes/export.php
95 95 $cat = get_term( $term['term_id'], 'category' ); 96 96 $cats = array( $cat->term_id => $cat ); 97 97 unset( $term, $cat ); 98 } else 98 } elseif ( 'all' == $args['content'] ) { 99 99 $categories = (array) get_categories( array( 'get' => 'all' ) ); 100 100 $tags = (array) get_tags( array( 'get' => 'all' ) ); 101 101 -
src/wp-admin/includes/file.php
929 929 // this means it's safe to modify & create new files via PHP. 930 930 $method = 'direct'; 931 931 $GLOBALS['_wp_filesystem_direct_method'] = 'file_owner'; 932 } else 932 } elseif ( $allow_relaxed_file_ownership ) { 933 933 // The $context directory is writable, and $allow_relaxed_file_ownership is set, this means we can modify files 934 934 // safely in this directory. This mode doesn't create new files, only alter existing ones. 935 935 $method = 'direct'; … … 1038 1038 unset($credentials['port']); 1039 1039 } 1040 1040 1041 if ( ( defined( 'FTP_SSH') && FTP_SSH ) || ( defined('FS_METHOD') && 'ssh2' == FS_METHOD ) )1041 if ( ( defined( 'FTP_SSH' ) && FTP_SSH ) || ( defined( 'FS_METHOD' ) && 'ssh2' == FS_METHOD ) ) { 1042 1042 $credentials['connection_type'] = 'ssh'; 1043 else if ( (defined('FTP_SSL') && FTP_SSL) && 'ftpext' == $type )//Only the FTP Extension understands SSL1043 } elseif ( ( defined( 'FTP_SSL' ) && FTP_SSL ) && 'ftpext' == $type ) { //Only the FTP Extension understands SSL 1044 1044 $credentials['connection_type'] = 'ftps'; 1045 else if ( !empty($_POST['connection_type']) )1045 } elseif ( ! empty( $_POST['connection_type'] ) ) { 1046 1046 $credentials['connection_type'] = wp_unslash( $_POST['connection_type'] ); 1047 else if ( !isset($credentials['connection_type']) )//All else fails (And it's not defaulted to something else saved), Default to FTP1047 } elseif ( ! isset( $credentials['connection_type'] ) ) { //All else fails (And it's not defaulted to something else saved), Default to FTP 1048 1048 $credentials['connection_type'] = 'ftp'; 1049 1049 } 1050 1050 if ( ! $error && 1051 1051 ( 1052 1052 ( !empty($credentials['password']) && !empty($credentials['username']) && !empty($credentials['hostname']) ) || -
src/wp-admin/includes/media.php
293 293 if ( ! empty( $meta['album'] ) && ! empty( $meta['artist'] ) ) { 294 294 /* translators: 1: audio track title, 2: album title, 3: artist name */ 295 295 $content .= sprintf( __( '"%1$s" from %2$s by %3$s.' ), $title, $meta['album'], $meta['artist'] ); 296 } else 296 } elseif ( ! empty( $meta['album'] ) ) { 297 297 /* translators: 1: audio track title, 2: album title */ 298 298 $content .= sprintf( __( '"%1$s" from %2$s.' ), $title, $meta['album'] ); 299 } else 299 } elseif ( ! empty( $meta['artist'] ) ) { 300 300 /* translators: 1: audio track title, 2: artist name */ 301 301 $content .= sprintf( __( '"%1$s" by %2$s.' ), $title, $meta['artist'] ); 302 302 } else { … … 303 303 $content .= sprintf( __( '"%s".' ), $title ); 304 304 } 305 305 306 } else 306 } elseif ( ! empty( $meta['album'] ) ) { 307 307 308 308 if ( ! empty( $meta['artist'] ) ) { 309 309 /* translators: 1: audio album title, 2: artist name */ … … 312 312 $content .= $meta['album'] . '.'; 313 313 } 314 314 315 } else 315 } elseif ( ! empty( $meta['artist'] ) ) { 316 316 317 317 $content .= $meta['artist'] . '.'; 318 318 -
src/wp-admin/includes/meta-boxes.php
166 166 if ( 0 != $post->ID ) { 167 167 if ( 'future' == $post->post_status ) { // scheduled for publishing at a future date 168 168 $stamp = __('Scheduled for: <b>%1$s</b>'); 169 } else 169 } elseif ( 'publish' == $post->post_status || 'private' == $post->post_status ) { // already published 170 170 $stamp = __('Published on: <b>%1$s</b>'); 171 } else 171 } elseif ( '0000-00-00 00:00:00' == $post->post_date_gmt ) { // draft, 1 or more saves, no date specified 172 172 $stamp = __('Publish <b>immediately</b>'); 173 } else 173 } elseif ( time() < strtotime( $post->post_date_gmt . ' +0000' ) ) { // draft, 1 or more saves, future date specified 174 174 $stamp = __('Schedule for: <b>%1$s</b>'); 175 175 } else { // draft, 1 or more saves, date specified 176 176 $stamp = __('Publish on: <b>%1$s</b>'); -
src/wp-admin/includes/ms.php
145 145 if ( $file == '.' || $file == '..' ) 146 146 continue; 147 147 148 if ( @is_dir( $dir . DIRECTORY_SEPARATOR . $file ) ) 148 if ( @is_dir( $dir . DIRECTORY_SEPARATOR . $file ) ) { 149 149 $stack[] = $dir . DIRECTORY_SEPARATOR . $file; 150 else if ( @is_file( $dir . DIRECTORY_SEPARATOR . $file ) )150 } elseif ( @is_file( $dir . DIRECTORY_SEPARATOR . $file ) ) { 151 151 @unlink( $dir . DIRECTORY_SEPARATOR . $file ); 152 } 152 153 } 153 154 @closedir( $dh ); 154 155 } -
src/wp-admin/includes/plugin-install.php
517 517 <?php 518 518 if ( ! empty( $api->tested ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $api->tested ) ), $api->tested, '>' ) ) { 519 519 echo '<div class="notice notice-warning"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been tested</strong> with your current version of WordPress.') . '</p></div>'; 520 } else 520 } elseif ( ! empty( $api->requires ) && version_compare( substr( $GLOBALS['wp_version'], 0, strlen( $api->requires ) ), $api->requires, '<' ) ) { 521 521 echo '<div class="notice notice-warning"><p>' . __('<strong>Warning:</strong> This plugin has <strong>not been marked as compatible</strong> with your version of WordPress.') . '</p></div>'; 522 522 } 523 523 -
src/wp-admin/includes/plugin.php
1652 1652 else 1653 1653 if ( isset( $admin_page_hooks[$parent] )) 1654 1654 $page_type = $admin_page_hooks[$parent]; 1655 } else 1655 } elseif ( isset( $admin_page_hooks[$parent] ) ) { 1656 1656 $page_type = $admin_page_hooks[$parent]; 1657 1657 } 1658 1658 … … 1713 1713 return true; 1714 1714 else 1715 1715 return false; 1716 } else 1716 } elseif ( $submenu_array[2] == $pagenow ) { 1717 1717 if ( current_user_can( $submenu_array[1] )) 1718 1718 return true; 1719 1719 else -
src/wp-admin/includes/taxonomy.php
66 66 */ 67 67 function wp_create_categories( $categories, $post_id = '' ) { 68 68 $cat_ids = array (); 69 foreach ( $categories as $category) {70 if ( $id = category_exists($category))69 foreach ( $categories as $category ) { 70 if ( $id = category_exists( $category ) ) { 71 71 $cat_ids[] = $id; 72 else73 if ($id = wp_create_category($category))74 $cat_ids[] = $id;72 } elseif ( $id = wp_create_category( $category ) ) { 73 $cat_ids[] = $id; 74 } 75 75 } 76 76 77 77 if ( $post_id ) -
src/wp-admin/includes/template.php
1848 1848 foreach ( $other_attributes as $attribute => $value ) { 1849 1849 $attributes .= $attribute . '="' . esc_attr( $value ) . '" '; // Trailing space is important 1850 1850 } 1851 } else if ( !empty( $other_attributes ) ) { // Attributes provided as a string1851 } elseif ( ! empty( $other_attributes ) ) { // Attributes provided as a string 1852 1852 $attributes = $other_attributes; 1853 1853 } 1854 1854 -
src/wp-admin/includes/theme.php
167 167 if ( ! current_user_can('update_themes') ) { 168 168 $html = sprintf( '<p><strong>' . __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>.' ) . '</strong></p>', 169 169 $theme_name, esc_url( $details_url ), esc_attr( $theme['Name'] ), $update['new_version'] ); 170 } else 170 } elseif ( empty( $update['package'] ) ) { 171 171 $html = sprintf( '<p><strong>' . __( 'There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>' ) . '</strong></p>', 172 172 $theme_name, esc_url( $details_url ), esc_attr( $theme['Name'] ), $update['new_version'] ); 173 173 } else { -
src/wp-admin/includes/update.php
278 278 if ( is_network_admin() || !is_multisite() ) { 279 279 echo '<tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">'; 280 280 281 if ( ! current_user_can( 'update_plugins') )281 if ( ! current_user_can( 'update_plugins' ) ) { 282 282 printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version ); 283 else if ( empty($r->package) )283 } elseif ( empty($r->package) ) { 284 284 printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this plugin.</em>'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version ); 285 else285 } else { 286 286 printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a> or <a href="%5$s">update now</a>.'), $plugin_name, esc_url($details_url), esc_attr($plugin_name), $r->new_version, wp_nonce_url( self_admin_url('update.php?action=upgrade-plugin&plugin=') . $file, 'upgrade-plugin_' . $file) ); 287 287 } 288 288 /** 289 289 * Fires at the end of the update message container in each 290 290 * row of the plugins list table. … … 367 367 $wp_list_table = _get_list_table('WP_MS_Themes_List_Table'); 368 368 369 369 echo '<tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">'; 370 if ( ! current_user_can('update_themes') ) 370 if ( ! current_user_can('update_themes') ) { 371 371 printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>.'), $theme['Name'], esc_url($details_url), esc_attr($theme['Name']), $r->new_version ); 372 else if ( empty( $r['package'] ) )372 } elseif ( empty( $r['package'] ) ) { 373 373 printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a>. <em>Automatic update is unavailable for this theme.</em>'), $theme['Name'], esc_url($details_url), esc_attr($theme['Name']), $r['new_version'] ); 374 else374 } else { 375 375 printf( __('There is a new version of %1$s available. <a href="%2$s" class="thickbox" title="%3$s">View version %4$s details</a> or <a href="%5$s">update now</a>.'), $theme['Name'], esc_url($details_url), esc_attr($theme['Name']), $r['new_version'], wp_nonce_url( self_admin_url('update.php?action=upgrade-theme&theme=') . $theme_key, 'upgrade-theme_' . $theme_key) ); 376 376 } 377 377 /** 378 378 * Fires at the end of the update message container in each 379 379 * row of the themes list table. -
src/wp-admin/includes/upgrade.php
74 74 $user_id = wp_create_user($user_name, $user_password, $user_email); 75 75 update_user_option($user_id, 'default_password_nag', true, true); 76 76 $email_password = true; 77 } else if ( !$user_id ) {77 } elseif ( ! $user_id ) { 78 78 // Password has been provided 79 79 $message = '<em>'.__('Your chosen password.').'</em>'; 80 80 $user_id = wp_create_user($user_name, $user_password, $user_email); … … 769 769 if ( 'static' == $status ) { 770 770 $status = 'publish'; 771 771 $type = 'page'; 772 } else 772 } elseif ( 'attachment' == $status ) { 773 773 $status = 'inherit'; 774 774 $type = 'attachment'; 775 775 } … … 1645 1645 1646 1646 // Create a tablename index for an array ($cqueries) of queries 1647 1647 foreach($queries as $qry) { 1648 if ( preg_match("|CREATE TABLE ([^ ]*)|", $qry, $matches)) {1648 if ( preg_match( "|CREATE TABLE ([^ ]*)|", $qry, $matches ) ) { 1649 1649 $cqueries[ trim( $matches[1], '`' ) ] = $qry; 1650 1650 $for_update[$matches[1]] = 'Created table '.$matches[1]; 1651 } else if (preg_match("|CREATE DATABASE ([^ ]*)|", $qry, $matches)) {1652 array_unshift( $cqueries, $qry);1653 } else if (preg_match("|INSERT INTO ([^ ]*)|", $qry, $matches)) {1651 } elseif ( preg_match( "|CREATE DATABASE ([^ ]*)|", $qry, $matches ) ) { 1652 array_unshift( $cqueries, $qry ); 1653 } elseif ( preg_match( "|INSERT INTO ([^ ]*)|", $qry, $matches ) ) { 1654 1654 $iqueries[] = $qry; 1655 } else if (preg_match("|UPDATE ([^ ]*)|", $qry, $matches)) {1655 } elseif ( preg_match( "|UPDATE ([^ ]*)|", $qry, $matches ) ) { 1656 1656 $iqueries[] = $qry; 1657 1657 } else { 1658 1658 // Unrecognized query type … … 1804 1804 $index_string = ''; 1805 1805 if ($index_name == 'PRIMARY') { 1806 1806 $index_string .= 'PRIMARY '; 1807 } else if($index_data['unique']) {1807 } elseif ( $index_data['unique'] ) { 1808 1808 $index_string .= 'UNIQUE '; 1809 1809 } 1810 1810 $index_string .= 'KEY '; -
src/wp-admin/install.php
254 254 // TODO: poka-yoke 255 255 display_setup_form( __( 'Your passwords do not match. Please try again.' ) ); 256 256 $error = true; 257 } else 257 } elseif ( empty( $admin_email ) ) { 258 258 // TODO: poka-yoke 259 259 display_setup_form( __( 'You must provide an email address.' ) ); 260 260 $error = true; -
src/wp-admin/menu-header.php
174 174 $class[] = 'current'; 175 175 // If plugin_page is set the parent must either match the current page or not physically exist. 176 176 // This allows plugin pages with the same hook to exist under different parents. 177 } else 177 } elseif ( 178 178 ( ! isset( $plugin_page ) && $self == $sub_item[2] ) || 179 179 ( isset( $plugin_page ) && $plugin_page == $sub_item[2] && ( $item[2] == $self_type || $item[2] == $self || file_exists($menu_file) === false ) ) 180 180 ) { -
src/wp-admin/options-permalink.php
151 151 <div id="message" class="updated"><p><?php 152 152 if ( ! is_multisite() ) { 153 153 if ( $iis7_permalinks ) { 154 if ( $permalink_structure && ! $usingpi && ! $writable ) 154 if ( $permalink_structure && ! $usingpi && ! $writable ) { 155 155 _e('You should update your web.config now.'); 156 else if ( $permalink_structure && ! $usingpi && $writable )156 } elseif ( $permalink_structure && ! $usingpi && $writable ) { 157 157 _e('Permalink structure updated. Remove write access on web.config file now!'); 158 else158 } else { 159 159 _e('Permalink structure updated.'); 160 } 160 161 } elseif ( $is_nginx ) { 161 162 _e('Permalink structure updated.'); 162 163 } else { -
src/wp-comments-post.php
121 121 if ( get_option('require_name_email') && !$user->exists() ) { 122 122 if ( 6 > strlen( $comment_author_email ) || '' == $comment_author ) { 123 123 wp_die( __( '<strong>ERROR</strong>: please fill the required fields (name, email).' ), 200 ); 124 } else 124 } elseif ( ! is_email( $comment_author_email ) ) { 125 125 wp_die( __( '<strong>ERROR</strong>: please enter a valid email address.' ), 200 ); 126 126 } 127 127 } -
src/wp-includes/bookmark.php
386 386 } else { 387 387 $value = esc_attr($value); 388 388 } 389 } else 389 } elseif ( 'db' == $context ) { 390 390 /** This filter is documented in wp-includes/post.php */ 391 391 $value = apply_filters( "pre_$field", $value ); 392 392 } else { … … 393 393 /** This filter is documented in wp-includes/post.php */ 394 394 $value = apply_filters( $field, $value, $bookmark_id, $context ); 395 395 396 if ( 'attribute' == $context ) 397 $value = esc_attr($value); 398 else if ( 'js' == $context ) 399 $value = esc_js($value); 396 if ( 'attribute' == $context ) { 397 $value = esc_attr( $value ); 398 } elseif ( 'js' == $context ) { 399 $value = esc_js( $value ); 400 } 400 401 } 401 402 402 403 return $value; -
src/wp-includes/class-http.php
893 893 894 894 $r = wp_parse_args( $args, $defaults ); 895 895 896 if ( isset( $r['headers']['User-Agent']) ) {896 if ( isset( $r['headers']['User-Agent'] ) ) { 897 897 $r['user-agent'] = $r['headers']['User-Agent']; 898 unset( $r['headers']['User-Agent']);899 } else if ( isset($r['headers']['user-agent']) ) {898 unset( $r['headers']['User-Agent'] ); 899 } elseif ( isset( $r['headers']['user-agent'] ) ) { 900 900 $r['user-agent'] = $r['headers']['user-agent']; 901 unset( $r['headers']['user-agent']);901 unset( $r['headers']['user-agent'] ); 902 902 } 903 903 904 904 // Construct Cookie: header if any cookies are set. … … 1358 1358 1359 1359 $r = wp_parse_args( $args, $defaults ); 1360 1360 1361 if ( isset( $r['headers']['User-Agent']) ) {1361 if ( isset( $r['headers']['User-Agent'] ) ) { 1362 1362 $r['user-agent'] = $r['headers']['User-Agent']; 1363 unset( $r['headers']['User-Agent']);1364 } else if ( isset($r['headers']['user-agent']) ) {1363 unset( $r['headers']['User-Agent'] ); 1364 } elseif ( isset( $r['headers']['user-agent'] ) ) { 1365 1365 $r['user-agent'] = $r['headers']['user-agent']; 1366 unset( $r['headers']['user-agent']);1366 unset( $r['headers']['user-agent'] ); 1367 1367 } 1368 1368 1369 1369 // Construct Cookie: header if any cookies are set. … … 2244 2244 if ( is_array( $headers ) ) { 2245 2245 if ( array_key_exists('content-encoding', $headers) && ! empty( $headers['content-encoding'] ) ) 2246 2246 return true; 2247 } else 2247 } elseif ( is_string( $headers ) ) { 2248 2248 return ( stripos($headers, 'content-encoding:') !== false ); 2249 2249 } 2250 2250 -
src/wp-includes/class-wp-xmlrpc-server.php
3211 3211 3212 3212 if ( !$user ) { 3213 3213 $logged_in = false; 3214 if ( $allow_anon && get_option('comment_registration') ) 3214 if ( $allow_anon && get_option('comment_registration') ) { 3215 3215 return new IXR_Error( 403, __( 'You must be registered to comment' ) ); 3216 else if ( !$allow_anon )3216 } elseif ( ! $allow_anon ) { 3217 3217 return $this->error; 3218 } 3218 3219 } else { 3219 3220 $logged_in = true; 3220 3221 } … … 4873 4874 $tags_input = isset( $content_struct['mt_keywords'] ) ? $content_struct['mt_keywords'] : null; 4874 4875 4875 4876 if ( ('publish' == $post_status) ) { 4876 if ( ( 'page' == $post_type ) && !current_user_can('publish_pages') ) 4877 return new IXR_Error(401, __('Sorry, you do not have the right to publish this page.')); 4878 else if ( !current_user_can('publish_posts') ) 4879 return new IXR_Error(401, __('Sorry, you do not have the right to publish this post.')); 4877 if ( ( 'page' == $post_type ) && ! current_user_can( 'publish_pages' ) ) { 4878 return new IXR_Error( 401, __( 'Sorry, you do not have the right to publish this page.' ) ); 4879 } elseif ( ! current_user_can( 'publish_posts' ) ) { 4880 return new IXR_Error( 401, __( 'Sorry, you do not have the right to publish this post.' ) ); 4881 } 4880 4882 } 4881 4883 4882 4884 if ( $post_more ) -
src/wp-includes/class-wp.php
135 135 $this->query_vars = array(); 136 136 $post_type_query_vars = array(); 137 137 138 if ( is_array( $extra_query_vars) )138 if ( is_array( $extra_query_vars ) ) { 139 139 $this->extra_query_vars = & $extra_query_vars; 140 else if (! empty($extra_query_vars))141 parse_str( $extra_query_vars, $this->extra_query_vars);142 140 } elseif ( ! empty( $extra_query_vars ) ) { 141 parse_str( $extra_query_vars, $this->extra_query_vars ); 142 } 143 143 // Process PATH_INFO, REQUEST_URI, and 404 for permalinks. 144 144 145 145 // Fetch the rewrite rules. … … 357 357 } elseif ( in_array( $status, array( 403, 500, 502, 503 ) ) ) { 358 358 $exit_required = true; 359 359 } 360 } else if ( empty($this->query_vars['feed']) ) {360 } elseif ( empty( $this->query_vars['feed'] ) ) { 361 361 $headers['Content-Type'] = get_option('html_type') . '; charset=' . get_option('blog_charset'); 362 362 } else { 363 363 // We're showing a feed, so WP is indeed the only thing that last changed -
src/wp-includes/comment-template.php
1168 1168 1169 1169 if ( $user_ID ) { 1170 1170 $comment_args['include_unapproved'] = array( $user_ID ); 1171 } else 1171 } elseif ( ! empty( $comment_author_email ) ) { 1172 1172 $comment_args['include_unapproved'] = array( $comment_author_email ); 1173 1173 } 1174 1174 -
src/wp-includes/comment.php
506 506 // Disable ORDER BY with 'none', an empty array, or boolean false. 507 507 if ( in_array( $this->query_vars['orderby'], array( 'none', array(), false ), true ) ) { 508 508 $orderby = ''; 509 } else 509 } elseif ( ! empty( $this->query_vars['orderby'] ) ) { 510 510 $ordersby = is_array( $this->query_vars['orderby'] ) ? 511 511 $this->query_vars['orderby'] : 512 512 preg_split( '/[,\s]/', $this->query_vars['orderby'] ); … … 2228 2228 2229 2229 if ( ! isset( $data['comment_approved'] ) ) { 2230 2230 $data['comment_approved'] = 1; 2231 } else 2231 } elseif ( 'hold' == $data['comment_approved'] ) { 2232 2232 $data['comment_approved'] = 0; 2233 } else 2233 } elseif ( 'approve' == $data['comment_approved'] ) { 2234 2234 $data['comment_approved'] = 1; 2235 2235 } 2236 2236 -
src/wp-includes/date.php
425 425 $valid = false; 426 426 } 427 427 428 } else 428 } elseif ( $day_exists && $month_exists ) { 429 429 /* 430 430 * 2. checking day, month combination 431 431 * We use 2012 because, as a leap year, it's the most permissive. … … 607 607 foreach ( $query as $key => $clause ) { 608 608 if ( 'relation' === $key ) { 609 609 $relation = $query['relation']; 610 } else 610 } elseif ( is_array( $clause ) ) { 611 611 612 612 // This is a first-order clause. 613 613 if ( $this->is_first_order_clause( $clause ) ) { … … 616 616 $where_count = count( $clause_sql['where'] ); 617 617 if ( ! $where_count ) { 618 618 $sql_chunks['where'][] = ''; 619 } else 619 } elseif ( 1 === $where_count ) { 620 620 $sql_chunks['where'][] = $clause_sql['where'][0]; 621 621 } else { 622 622 $sql_chunks['where'][] = '( ' . implode( ' AND ', $clause_sql['where'] ) . ' )'; … … 725 725 if ( isset( $query['year'] ) && $value = $this->build_value( $compare, $query['year'] ) ) 726 726 $where_parts[] = "YEAR( $column ) $compare $value"; 727 727 728 if ( isset( $query['month'] ) && $value = $this->build_value( $compare, $query['month'] ) ) 728 if ( isset( $query['month'] ) && $value = $this->build_value( $compare, $query['month'] ) ) { 729 729 $where_parts[] = "MONTH( $column ) $compare $value"; 730 else if ( isset( $query['monthnum'] ) && $value = $this->build_value( $compare, $query['monthnum'] ) )730 } elseif ( isset( $query['monthnum'] ) && $value = $this->build_value( $compare, $query['monthnum'] ) ) { 731 731 $where_parts[] = "MONTH( $column ) $compare $value"; 732 733 if ( isset( $query['week'] ) && false !== ( $value = $this->build_value( $compare, $query['week'] ) ) ) 732 } 733 if ( isset( $query['week'] ) && false !== ( $value = $this->build_value( $compare, $query['week'] ) ) ) { 734 734 $where_parts[] = _wp_mysql_week( $column ) . " $compare $value"; 735 else if ( isset( $query['w'] ) && false !== ( $value = $this->build_value( $compare, $query['w'] ) ) )735 } elseif ( isset( $query['w'] ) && false !== ( $value = $this->build_value( $compare, $query['w'] ) ) ) { 736 736 $where_parts[] = _wp_mysql_week( $column ) . " $compare $value"; 737 737 } 738 738 if ( isset( $query['dayofyear'] ) && $value = $this->build_value( $compare, $query['dayofyear'] ) ) 739 739 $where_parts[] = "DAYOFYEAR( $column ) $compare $value"; 740 740 … … 858 858 'year' => intval( $matches[1] ), 859 859 ); 860 860 861 } else 861 } elseif ( preg_match( '/^(\d{4})\-(\d{2})$/', $datetime, $matches ) ) { 862 862 // Y-m 863 863 $datetime = array( 864 864 'year' => intval( $matches[1] ), … … 865 865 'month' => intval( $matches[2] ), 866 866 ); 867 867 868 } else 868 } elseif ( preg_match( '/^(\d{4})\-(\d{2})\-(\d{2})$/', $datetime, $matches ) ) { 869 869 // Y-m-d 870 870 $datetime = array( 871 871 'year' => intval( $matches[1] ), … … 873 873 'day' => intval( $matches[3] ), 874 874 ); 875 875 876 } else 876 } elseif ( preg_match( '/^(\d{4})\-(\d{2})\-(\d{2}) (\d{2}):(\d{2})$/', $datetime, $matches ) ) { 877 877 // Y-m-d H:i 878 878 $datetime = array( 879 879 'year' => intval( $matches[1] ), -
src/wp-includes/deprecated.php
2396 2396 2397 2397 if ( !$cur ) 2398 2398 $wpdb->insert($wpdb->usermeta, compact('user_id', 'meta_key', 'meta_value') ); 2399 else 2399 elseif ( $cur->meta_value != $meta_value ) 2400 2400 $wpdb->update($wpdb->usermeta, compact('meta_value'), compact('user_id', 'meta_key') ); 2401 2401 else 2402 2402 return false; -
src/wp-includes/formatting.php
1502 1502 // or close to be safe $tag = '/' . $tag; 1503 1503 } 1504 1504 // if stacktop value = tag close value then pop 1505 else 1505 elseif ( $tagstack[$stacksize - 1] == $tag ) { // found closing tag 1506 1506 $tag = '</' . $tag . '>'; // Close Tag 1507 1507 // Pop 1508 1508 array_pop( $tagstack ); … … 2337 2337 2338 2338 return gmdate('Y-m-d H:i:s', $timestamp); 2339 2339 2340 } else 2340 } elseif ($timezone == 'user') { 2341 2341 return preg_replace('#([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(Z|[\+|\-][0-9]{2,4}){0,1}#', '$1-$2-$3 $4:$5:$6', $date_string); 2342 2342 } 2343 2343 } -
src/wp-includes/functions.php
1437 1437 $ref = false; 1438 1438 if ( ! empty( $_REQUEST['_wp_http_referer'] ) ) 1439 1439 $ref = wp_unslash( $_REQUEST['_wp_http_referer'] ); 1440 else 1440 elseif ( ! empty( $_SERVER['HTTP_REFERER'] ) ) 1441 1441 $ref = wp_unslash( $_SERVER['HTTP_REFERER'] ); 1442 1442 1443 1443 if ( $ref && $ref !== wp_unslash( $_SERVER['REQUEST_URI'] ) ) … … 1670 1670 */ 1671 1671 function win_is_writable( $path ) { 1672 1672 1673 if ( $path[strlen( $path ) - 1] == '/' ) // if it looks like a directory, check a random file within the directory1673 if ( $path[strlen( $path ) - 1] == '/' ) { // if it looks like a directory, check a random file within the directory 1674 1674 return win_is_writable( $path . uniqid( mt_rand() ) . '.tmp'); 1675 else if ( is_dir( $path ) )// If it's a directory (and not a file) check a random file within the directory1675 } elseif ( is_dir( $path ) ) { // If it's a directory (and not a file) check a random file within the directory 1676 1676 return win_is_writable( $path . '/' . uniqid( mt_rand() ) . '.tmp' ); 1677 1677 } 1678 1678 // check tmp file for read/write capabilities 1679 1679 $should_delete_tmp_file = !file_exists( $path ); 1680 1680 $f = @fopen( $path, 'a' ); -
src/wp-includes/l10n.php
594 594 595 595 if ( false !== $plugin_rel_path ) { 596 596 $path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/' ); 597 } else 597 } elseif ( false !== $deprecated ) { 598 598 _deprecated_argument( __FUNCTION__, '2.7' ); 599 599 $path = ABSPATH . trim( $deprecated, '/' ); 600 600 } else { -
src/wp-includes/load.php
59 59 $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_ORIGINAL_URL']; 60 60 } 61 61 // IIS Isapi_Rewrite 62 else 62 elseif ( isset( $_SERVER['HTTP_X_REWRITE_URL'] ) ) { 63 63 $_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL']; 64 64 } else { 65 65 // Use ORIG_PATH_INFO if there is no PATH_INFO … … 427 427 } 428 428 429 429 $first_init = true; 430 } else 430 } elseif ( ! wp_using_ext_object_cache() && file_exists( WP_CONTENT_DIR . '/object-cache.php' ) ) { 431 431 /* 432 432 * Sometimes advanced-cache.php can load object-cache.php before 433 433 * it is loaded here. This breaks the function_exists check above -
src/wp-includes/media.php
1984 1984 * @return array Empty array on failure. List of taxonomies on success. 1985 1985 */ 1986 1986 function get_attachment_taxonomies($attachment) { 1987 if ( is_int( $attachment ) ) 1988 $attachment = get_post( $attachment);1989 else if ( is_array($attachment) )1987 if ( is_int( $attachment ) ) { 1988 $attachment = get_post( $attachment ); 1989 } elseif ( is_array( $attachment ) ) { 1990 1990 $attachment = (object) $attachment; 1991 1991 } 1992 1992 if ( ! is_object($attachment) ) 1993 1993 return array(); 1994 1994 -
src/wp-includes/meta.php
995 995 if ( 'relation' === $key ) { 996 996 $relation = $query; 997 997 998 } else 998 } elseif ( ! is_array( $query ) ) { 999 999 continue; 1000 1000 1001 1001 // First-order clause. 1002 } else 1002 } elseif ( $this->is_first_order_clause( $query ) ) { 1003 1003 if ( isset( $query['value'] ) && array() === $query['value'] ) { 1004 1004 unset( $query['value'] ); 1005 1005 } … … 1029 1029 * This value will not actually be used to join clauses, but it 1030 1030 * simplifies the logic around combining key-only queries. 1031 1031 */ 1032 } else 1032 } elseif ( 1 === count( $clean_queries ) ) { 1033 1033 $clean_queries['relation'] = 'OR'; 1034 1034 1035 1035 // Default to AND. … … 1093 1093 $primary_meta_query, 1094 1094 $existing_meta_query, 1095 1095 ); 1096 } else 1096 } elseif ( ! empty( $primary_meta_query ) ) { 1097 1097 $meta_query = array( 1098 1098 $primary_meta_query, 1099 1099 ); 1100 } else 1100 } elseif ( ! empty( $existing_meta_query ) ) { 1101 1101 $meta_query = $existing_meta_query; 1102 1102 } 1103 1103 … … 1254 1254 foreach ( $query as $key => &$clause ) { 1255 1255 if ( 'relation' === $key ) { 1256 1256 $relation = $query['relation']; 1257 } else 1257 } elseif ( is_array( $clause ) ) { 1258 1258 1259 1259 // This is a first-order clause. 1260 1260 if ( $this->is_first_order_clause( $clause ) ) { … … 1263 1263 $where_count = count( $clause_sql['where'] ); 1264 1264 if ( ! $where_count ) { 1265 1265 $sql_chunks['where'][] = ''; 1266 } else 1266 } elseif ( 1 === $where_count ) { 1267 1267 $sql_chunks['where'][] = $clause_sql['where'][0]; 1268 1268 } else { 1269 1269 $sql_chunks['where'][] = '( ' . implode( ' AND ', $clause_sql['where'] ) . ' )'; … … 1492 1492 $compatible_compares = array( '=', 'IN', 'BETWEEN', 'LIKE', 'REGEXP', 'RLIKE', '>', '>=', '<', '<=' ); 1493 1493 1494 1494 // Clauses joined by AND with "negative" operators share a join only if they also share a key. 1495 } else 1495 } elseif ( isset( $sibling['key'] ) && isset( $clause['key'] ) && $sibling['key'] === $clause['key'] ) { 1496 1496 $compatible_compares = array( '!=', 'NOT IN', 'NOT LIKE' ); 1497 1497 } 1498 1498 -
src/wp-includes/nav-menu.php
806 806 'post_type' == $menu_item_type 807 807 ) { 808 808 $menu_item_ids[] = (int) $menu_item->ID; 809 } else 809 } elseif ( 810 810 'taxonomy' == $object_type && 811 811 'taxonomy' == $menu_item_type && 812 812 get_post_meta( $menu_item->ID, '_menu_item_object', true ) == $taxonomy -
src/wp-includes/plugin.php
327 327 if ( isset( $wp_filter[ $tag ]) ) { 328 328 if ( false === $priority ) { 329 329 $wp_filter[ $tag ] = array(); 330 } else 330 } elseif ( isset( $wp_filter[ $tag ][ $priority ] ) ) { 331 331 $wp_filter[ $tag ][ $priority ] = array(); 332 332 } 333 333 } … … 900 900 901 901 return $obj_idx; 902 902 } 903 } else if ( is_string($function[0]) ) {903 } elseif ( is_string( $function[0] ) ) { 904 904 // Static Calling 905 905 return $function[0] . '::' . $function[1]; 906 906 } -
src/wp-includes/post-template.php
129 129 */ 130 130 $protected_title_format = apply_filters( 'protected_title_format', __( 'Protected: %s' ), $post ); 131 131 $title = sprintf( $protected_title_format, $title ); 132 } else 132 } elseif ( isset( $post->post_status ) && 'private' == $post->post_status ) { 133 133 134 134 /** 135 135 * Filter the text prepended to the post title of private posts. … … 566 566 if ( is_array( $post_type ) ) 567 567 $post_type = reset( $post_type ); 568 568 $classes[] = 'post-type-archive-' . sanitize_html_class( $post_type ); 569 } else 569 } elseif ( is_author() ) { 570 570 $author = $wp_query->get_queried_object(); 571 571 $classes[] = 'author'; 572 572 if ( isset( $author->user_nicename ) ) { -
src/wp-includes/post.php
2184 2184 } else { 2185 2185 $value = esc_attr($value); 2186 2186 } 2187 } else 2187 } elseif ( 'db' == $context ) { 2188 2188 if ( $prefixed ) { 2189 2189 2190 2190 /** … … 2252 2252 2253 2253 if ( 'attribute' == $context ) 2254 2254 $value = esc_attr($value); 2255 else 2255 elseif ( 'js' == $context ) 2256 2256 $value = esc_js($value); 2257 2257 2258 2258 return $value; … … 3907 3907 } else { 3908 3908 $post_categories = array(); 3909 3909 } 3910 } else if ( 1 == count($post_categories) && '' == reset($post_categories) ) {3910 } elseif ( 1 == count( $post_categories ) && '' == reset( $post_categories ) ) { 3911 3911 return true; 3912 3912 } 3913 3913 -
src/wp-includes/query.php
1654 1654 $this->is_date = true; 1655 1655 if ( strlen($qv['m']) > 9 ) { 1656 1656 $this->is_time = true; 1657 } else if ( strlen($qv['m']) > 7 ) {1657 } elseif ( strlen( $qv['m'] ) > 7 ) { 1658 1658 $this->is_day = true; 1659 } else if ( strlen($qv['m']) > 5 ) {1659 } elseif ( strlen( $qv['m'] ) > 5 ) { 1660 1660 $this->is_month = true; 1661 1661 } else { 1662 1662 $this->is_year = true; … … 1956 1956 $tag = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db'); 1957 1957 $q['tag_slug__in'][] = $tag; 1958 1958 } 1959 } else if ( preg_match('/[+\r\n\t ]+/', $q['tag']) || !empty($q['cat']) ) {1959 } elseif ( preg_match('/[+\r\n\t ]+/', $q['tag'] ) || ! empty( $q['cat'] ) ) { 1960 1960 $tags = preg_split('/[+\r\n\t ]+/', $q['tag']); 1961 1961 foreach ( (array) $tags as $tag ) { 1962 1962 $tag = sanitize_term_field('slug', $tag, 0, 'post_tag', 'db'); … … 2467 2467 $q['posts_per_page'] = (int) $q['posts_per_page']; 2468 2468 if ( $q['posts_per_page'] < -1 ) 2469 2469 $q['posts_per_page'] = abs($q['posts_per_page']); 2470 else 2470 elseif ( $q['posts_per_page'] == 0 ) 2471 2471 $q['posts_per_page'] = 1; 2472 2472 2473 2473 if ( !isset($q['comments_per_page']) || $q['comments_per_page'] == 0 ) … … 4350 4350 return true; 4351 4351 } elseif ( in_array( $page_obj->post_title, $page ) ) { 4352 4352 return true; 4353 } else 4353 } elseif ( in_array( $page_obj->post_name, $page ) ) { 4354 4354 return true; 4355 4355 } else { 4356 4356 foreach ( $page as $pagepath ) { … … 4568 4568 */ 4569 4569 if ( $post->ID === get_queried_object_id() && ( $this->is_page() || $this->is_single() ) ) { 4570 4570 $more = 1; 4571 } else 4571 } elseif ( $this->is_feed() ) { 4572 4572 $more = 1; 4573 4573 } else { 4574 4574 $more = 0; -
src/wp-includes/rewrite.php
1376 1376 $rewrite = array_merge($rewrite, array($pagematch => $pagequery)); 1377 1377 1378 1378 //only on pages with comments add ../comment-page-xx/ 1379 if ( EP_PAGES & $ep_mask || EP_PERMALINK & $ep_mask ) 1379 if ( EP_PAGES & $ep_mask || EP_PERMALINK & $ep_mask ) { 1380 1380 $rewrite = array_merge($rewrite, array($commentmatch => $commentquery)); 1381 else if ( EP_ROOT & $ep_mask && get_option('page_on_front') )1381 } elseif ( EP_ROOT & $ep_mask && get_option('page_on_front') ) { 1382 1382 $rewrite = array_merge($rewrite, array($rootcommentmatch => $rootcommentquery)); 1383 1383 } 1384 1384 //do endpoints 1385 1385 if ( $endpoints ) { 1386 1386 foreach ( (array) $ep_query_append as $regex => $ep) { -
src/wp-includes/template.php
467 467 if ( file_exists(STYLESHEETPATH . '/' . $template_name)) { 468 468 $located = STYLESHEETPATH . '/' . $template_name; 469 469 break; 470 } else 470 } elseif ( file_exists(TEMPLATEPATH . '/' . $template_name) ) { 471 471 $located = TEMPLATEPATH . '/' . $template_name; 472 472 break; 473 473 } -
src/wp-includes/user.php
630 630 $orderby = 'ID'; 631 631 } elseif ( 'meta_value' == $qv['orderby'] ) { 632 632 $orderby = "$wpdb->usermeta.meta_value"; 633 } else 633 } elseif ( 'include' === $qv['orderby'] && ! empty( $include ) ) { 634 634 // Sanitized earlier. 635 635 $include_sql = implode( ',', $include ); 636 636 $orderby = "FIELD( $wpdb->users.ID, $include_sql )"; … … 1514 1514 $value = esc_html( $value ); // textarea_escaped? 1515 1515 else 1516 1516 $value = esc_attr($value); 1517 } else 1517 } elseif ( 'db' == $context ) { 1518 1518 if ( $prefixed ) { 1519 1519 /** This filter is documented in wp-includes/post.php */ 1520 1520 $value = apply_filters( "pre_{$field}", $value ); … … 1559 1559 if ( 'user_url' == $field ) 1560 1560 $value = esc_url($value); 1561 1561 1562 if ( 'attribute' == $context ) 1563 $value = esc_attr( $value);1564 else if ( 'js' == $context )1565 $value = esc_js( $value);1566 1562 if ( 'attribute' == $context ) { 1563 $value = esc_attr( $value ); 1564 } elseif ( 'js' == $context ) { 1565 $value = esc_js( $value ); 1566 } 1567 1567 return $value; 1568 1568 } 1569 1569 -
src/wp-includes/wp-db.php
1366 1366 while ( mysqli_more_results( $this->dbh ) ) { 1367 1367 mysqli_next_result( $this->dbh ); 1368 1368 } 1369 } else 1369 } elseif ( is_resource( $this->result ) ) { 1370 1370 mysql_free_result( $this->result ); 1371 1371 } 1372 1372 } … … 1435 1435 1436 1436 if ( $this->has_connected ) { 1437 1437 $attempt_fallback = false; 1438 } else 1438 } elseif ( defined( 'WP_USE_EXT_MYSQL' ) && ! WP_USE_EXT_MYSQL ) { 1439 1439 $attempt_fallback = false; 1440 } else 1440 } elseif ( ! function_exists( 'mysql_connect' ) ) { 1441 1441 $attempt_fallback = false; 1442 1442 } 1443 1443 … … 1475 1475 " ), htmlspecialchars( $this->dbhost, ENT_QUOTES ) ), 'db_connect_fail' ); 1476 1476 1477 1477 return false; 1478 } else 1478 } elseif ( $this->dbh ) { 1479 1479 $this->has_connected = true; 1480 1480 $this->set_charset( $this->dbh ); 1481 1481 $this->ready = true; … … 1673 1673 $this->last_result[$num_rows] = $row; 1674 1674 $num_rows++; 1675 1675 } 1676 } else 1676 } elseif ( is_resource( $this->result ) ) { 1677 1677 while ( $row = @mysql_fetch_object( $this->result ) ) { 1678 1678 $this->last_result[$num_rows] = $row; 1679 1679 $num_rows++; -
src/wp-login.php
276 276 277 277 if ( empty( $_POST['user_login'] ) ) { 278 278 $errors->add('empty_username', __('<strong>ERROR</strong>: Enter a username or e-mail address.')); 279 } else 279 } elseif ( strpos( $_POST['user_login'], '@' ) ) { 280 280 $user_data = get_user_by( 'email', trim( $_POST['user_login'] ) ); 281 281 if ( empty( $user_data ) ) 282 282 $errors->add('invalid_email', __('<strong>ERROR</strong>: There is no user registered with that email address.')); … … 333 333 */ 334 334 $allow = apply_filters( 'allow_password_reset', true, $user_data->ID ); 335 335 336 if ( ! $allow ) 337 return new WP_Error( 'no_password_reset', __('Password reset is not allowed for this user'));338 else if ( is_wp_error($allow) )336 if ( ! $allow ) { 337 return new WP_Error( 'no_password_reset', __('Password reset is not allowed for this user') ); 338 } elseif ( is_wp_error( $allow ) ) { 339 339 return $allow; 340 } 340 341 341 342 // Generate something random for a password reset key. 342 343 $key = wp_generate_password( 20, false );