Changeset 46176
- Timestamp:
- 09/19/2019 01:53:03 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/functions.php
r46175 r46176 812 812 global $wpdb; 813 813 814 // TODO: Tidy this ghetto code up and make the debug code optional814 // @todo Tidy this code and make the debug code optional. 815 815 include_once( ABSPATH . WPINC . '/class-IXR.php' ); 816 816 … … 831 831 832 832 foreach ( $pung as $link_test ) { 833 if ( ! in_array( $link_test, $post_links_temp ) ) { // link no longer in post 833 // Link is no longer in post. 834 if ( ! in_array( $link_test, $post_links_temp, true ) ) { 834 835 $mids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE %s", $post->ID, $wpdb->esc_like( $link_test ) . '%' ) ); 835 836 foreach ( $mids as $mid ) { … … 840 841 841 842 foreach ( (array) $post_links_temp as $link_test ) { 842 if ( ! in_array( $link_test, $pung ) ) { // If we haven't pung it already 843 // If we haven't pung it already. 844 if ( ! in_array( $link_test, $pung, true ) ) { 843 845 $test = @parse_url( $link_test ); 844 846 if ( false === $test ) { … … 847 849 if ( isset( $test['query'] ) ) { 848 850 $post_links[] = $link_test; 849 } elseif ( isset( $test['path'] ) && ( $test['path'] != '/' ) && ( $test['path'] != '') ) {851 } elseif ( isset( $test['path'] ) && ( '/' !== $test['path'] ) && ( '' !== $test['path'] ) ) { 850 852 $post_links[] = $link_test; 851 853 } … … 867 869 868 870 foreach ( (array) $post_links as $url ) { 869 if ( $url != ''&& ! $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE %s", $post->ID, $wpdb->esc_like( $url ) . '%' ) ) ) {871 if ( '' !== $url && ! $wpdb->get_var( $wpdb->prepare( "SELECT post_id FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE %s", $post->ID, $wpdb->esc_like( $url ) . '%' ) ) ) { 870 872 871 873 $headers = wp_get_http_headers( $url ); … … 890 892 } 891 893 892 if ( in_array( substr( $type, 0, strpos( $type, '/' ) ), $allowed_types ) ) {894 if ( in_array( substr( $type, 0, strpos( $type, '/' ) ), $allowed_types, true ) ) { 893 895 add_post_meta( $post->ID, 'enclosure', "$url\n$len\n$mime\n" ); 894 896 }
Note: See TracChangeset
for help on using the changeset viewer.