﻿id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc
14493,"do_enclose() can ping the same URL many times, can't filter URLs to ping",mdawaffe,nacin,"If the same URL is included in a post several times, do_enclose() can check that URL for inclusion as a possible enclosure several times.

Additionally, there's no way to filter what URLs do_enclose() should ping for possible inclusion as enclosures.

Attached adds an array_unique() call to do_enclose().

Attached adds a {{{do_action_ref_array( 'pre_enclose', array( &$post_links, &$pung ) )}}} hook to allow filtration of URLs to ping.  (Matches the pre_ping hook.)

do_enclose() has several more problems this patch addresses.

 1. Correct non-functional DELETE FROM postmeta query (bad use of wpdb::prepare()).
 2. Use like_escape() in several LIKE queries.
 3. Add an {{{apply_filters( 'enclosure_mime_types', array( 'video', 'audio' ) )}}} hook.
 4. Currently do_enclose() doesn't allow root URLs as enclosures (e.g. http://example.com/), only URLs with a non-trivial path or query.  Move that functionality to the new pre_enclose filter.
 5. Efficiency improvements in conditional logic.
 6. Clean up code by reducing control structure nesting depth.",enhancement,accepted,normal,Future Release,Feeds,3.0.1,normal,,has-patch 3.6-early,
