Changeset 47219 for trunk/src/wp-admin/includes/ajax-actions.php
- Timestamp:
- 02/09/2020 04:52:28 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/ajax-actions.php
r47198 r47219 150 150 * ensure it's a non-negative, non-zero integer. 151 151 */ 152 if ( ( $term_search_min_chars == 0) || ( strlen( $s ) < $term_search_min_chars ) ) {152 if ( ( 0 == $term_search_min_chars ) || ( strlen( $s ) < $term_search_min_chars ) ) { 153 153 wp_die(); 154 154 } … … 296 296 } 297 297 298 $include_blog_users = ( $type == 'search'? get_users(298 $include_blog_users = ( 'search' === $type ? get_users( 299 299 array( 300 300 'blog_id' => $id, … … 303 303 ) : array() ); 304 304 305 $exclude_blog_users = ( $type == 'add'? get_users(305 $exclude_blog_users = ( 'add' === $type ? get_users( 306 306 array( 307 307 'blog_id' => $id, … … 392 392 393 393 $pagenow = $_GET['pagenow']; 394 if ( $pagenow === 'dashboard-user' || $pagenow === 'dashboard-network' || $pagenow === 'dashboard') {394 if ( 'dashboard-user' === $pagenow || 'dashboard-network' === $pagenow || 'dashboard' === $pagenow ) { 395 395 set_current_screen( $pagenow ); 396 396 } … … 574 574 } 575 575 576 if ( $taxonomy->name == 'category') {576 if ( 'category' === $taxonomy->name ) { 577 577 $post_category = isset( $_POST['post_category'] ) ? (array) $_POST['post_category'] : array(); 578 578 } else { … … 718 718 719 719 // Undo trash, not in trash. 720 if ( ! isset( $_POST['comment_status'] ) || $_POST['comment_status'] != 'trash') {720 if ( ! isset( $_POST['comment_status'] ) || 'trash' !== $_POST['comment_status'] ) { 721 721 $delta = 1; 722 722 } … … 735 735 736 736 // Undo spam, not in spam. 737 if ( ! isset( $_POST['comment_status'] ) || $_POST['comment_status'] != 'spam') {737 if ( ! isset( $_POST['comment_status'] ) || 'spam' !== $_POST['comment_status'] ) { 738 738 $delta = 1; 739 739 } … … 1319 1319 $parent = get_comment( $comment_parent ); 1320 1320 1321 if ( $parent && $parent->comment_approved === '0'&& $parent->comment_post_ID == $comment_post_ID ) {1321 if ( $parent && '0' === $parent->comment_approved && $parent->comment_post_ID == $comment_post_ID ) { 1322 1322 if ( ! current_user_can( 'edit_comment', $parent->comment_ID ) ) { 1323 1323 wp_die( -1 ); … … 1550 1550 1551 1551 // If the post is an autodraft, save the post as a draft and then attempt to save the meta. 1552 if ( $post->post_status == 'auto-draft') {1552 if ( 'auto-draft' === $post->post_status ) { 1553 1553 $post_data = array(); 1554 1554 $post_data['action'] = 'draft'; // Warning fix. … … 1721 1721 $page = isset( $_POST['page'] ) ? $_POST['page'] : ''; 1722 1722 1723 if ( $page != sanitize_key( $page )) {1723 if ( sanitize_key( $page ) != $page ) { 1724 1724 wp_die( 0 ); 1725 1725 } … … 1752 1752 $page = isset( $_POST['page'] ) ? $_POST['page'] : ''; 1753 1753 1754 if ( $page != sanitize_key( $page )) {1754 if ( sanitize_key( $page ) != $page ) { 1755 1755 wp_die( 0 ); 1756 1756 } … … 1901 1901 $page_columns = isset( $_POST['page_columns'] ) ? $_POST['page_columns'] : 'auto'; 1902 1902 1903 if ( $page_columns != 'auto') {1903 if ( 'auto' !== $page_columns ) { 1904 1904 $page_columns = (int) $page_columns; 1905 1905 } … … 1907 1907 $page = isset( $_POST['page'] ) ? $_POST['page'] : ''; 1908 1908 1909 if ( $page != sanitize_key( $page )) {1909 if ( sanitize_key( $page ) != $page ) { 1910 1910 wp_die( 0 ); 1911 1911 } … … 2004 2004 $msg_template = __( 'Saving is disabled: %s is currently editing this post.' ); 2005 2005 2006 if ( $_POST['post_type'] == 'page') {2006 if ( 'page' === $_POST['post_type'] ) { 2007 2007 /* translators: %s: User's display name. */ 2008 2008 $msg_template = __( 'Saving is disabled: %s is currently editing this page.' ); … … 2068 2068 $wp_list_table = _get_list_table( 'WP_Posts_List_Table', array( 'screen' => $_POST['screen'] ) ); 2069 2069 2070 $mode = $_POST['post_view'] === 'excerpt'? 'excerpt' : 'list';2070 $mode = 'excerpt' === $_POST['post_view'] ? 'excerpt' : 'list'; 2071 2071 2072 2072 $level = 0; … … 2640 2640 } 2641 2641 2642 if ( $thumbnail_id == '-1') {2642 if ( '-1' == $thumbnail_id ) { 2643 2643 if ( delete_post_thumbnail( $post_ID ) ) { 2644 2644 $return = _wp_post_thumbnail_html( null, $post_ID ); … … 2820 2820 $active_lock = array_map( 'absint', explode( ':', $_POST['active_post_lock'] ) ); 2821 2821 2822 if ( $active_lock[1] != get_current_user_id()) {2822 if ( get_current_user_id() != $active_lock[1] ) { 2823 2823 wp_die( 0 ); 2824 2824 } … … 2845 2845 $pointer = $_POST['pointer']; 2846 2846 2847 if ( $pointer != sanitize_key( $pointer )) {2847 if ( sanitize_key( $pointer ) != $pointer ) { 2848 2848 wp_die( 0 ); 2849 2849 } … … 3023 3023 if ( isset( $changes['alt'] ) ) { 3024 3024 $alt = wp_unslash( $changes['alt'] ); 3025 if ( $alt != get_post_meta( $id, '_wp_attachment_image_alt', true )) {3025 if ( get_post_meta( $id, '_wp_attachment_image_alt', true ) !== $alt ) { 3026 3026 $alt = wp_strip_all_tags( $alt, true ); 3027 3027 update_post_meta( $id, '_wp_attachment_image_alt', wp_slash( $alt ) ); … … 3817 3817 $sessions = WP_Session_Tokens::get_instance( $user->ID ); 3818 3818 3819 if ( $user->ID === get_current_user_id()) {3819 if ( get_current_user_id() === $user->ID ) { 3820 3820 $sessions->destroy_others( wp_get_session_token() ); 3821 3821 $message = __( 'You are now logged out everywhere else.' );
Note: See TracChangeset
for help on using the changeset viewer.