Skip to content

Commit

Permalink
Explain checks in get_external_images()
Browse files Browse the repository at this point in the history
  • Loading branch information
evansolomon committed Oct 14, 2012
1 parent ff19948 commit 638099f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions import-linked-images.php
Expand Up @@ -34,9 +34,11 @@ function get_external_images( $content ) {

preg_match_all( '#<img[^>]* src=[\'"]?([^>\'" ]+)#', $content, $sources );
foreach ( $sources[1] as $src ) {
// Has to at least look like a valid domain
if ( ! preg_match( '#^https?://#', $src ) )
continue;

// ...but not this domain
if ( $siteurl == substr( $src, 0, strlen( $siteurl ) ) )
continue;

Expand Down

0 comments on commit 638099f

Please sign in to comment.