WordPress.org

Plugin Directory

Changeset 651158


Ignore:
Timestamp:
01/11/13 04:06:51 (15 months ago)
Author:
cfinke
Message:

Photon: A more specific <a><img></a> regex in order to avoid matching this:

<a id="foo"></a>

as a partial opening <a> tag.

See http://wordpress.org/support/topic/photon-is-stripping-out-video-embed-code-in-211?replies=8

Location:
jetpack
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • jetpack/trunk/class.photon.php

    r650354 r651158  
    9191        $images = array(); 
    9292 
    93         if ( preg_match_all( '#(?:<a.+?href=["|\'](?P<link_url>.+?)["|\'].*?>\s*)?(?P<img_tag><img.+?src=["|\'](?P<img_url>.+?)["|\'].*?>){1}(?:\s*</a>)?#is', $content, $images ) ) { 
     93        if ( preg_match_all( '#(?:<a[^>]+?href=["|\'](?P<link_url>.+?)["|\'][^>]*?>\s*)?(?P<img_tag><img[^>]+?src=["|\'](?P<img_url>.+?)["|\'].*?>){1}(?:\s*</a>)?#is', $content, $images ) ) { 
    9494            foreach ( $images as $key => $unused ) { 
    9595                // Simplify the output as much as possible, mostly for confirming test results. 
Note: See TracChangeset for help on using the changeset viewer.