Make WordPress Core

Ticket #6840: fix_stale_enclosures.patch

File fix_stale_enclosures.patch, 758 bytes (added by my_user_name_was_not_valid, 17 years ago)
  • wp-includes/functions.php

     
    510510        debug_fwrite( $log, 'Post contents:' );
    511511        debug_fwrite( $log, $content . "\n" );
    512512
     513        foreach ( $pung as $link_test ) {
     514                if ( !in_array( $link_test, $post_links_temp[0] ) ) { // link no longer in post
     515                        $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->postmeta WHERE post_id = %d AND meta_key = 'enclosure' AND meta_value LIKE (%s)", $post_ID, $link_test . '%') );
     516                }
     517        }
     518       
    513519        foreach ( $post_links_temp[0] as $link_test ) {
    514520                if ( !in_array( $link_test, $pung ) ) { // If we haven't pung it already
    515521                        $test = parse_url( $link_test );