Skip to content

Commit

Permalink
Correction in regex
Browse files Browse the repository at this point in the history
The old version caused problems when the host is an IP address. The new version will not match with JPEG 2000 (.JP2) images though.
  • Loading branch information
jaspermdegroot committed Sep 15, 2015
1 parent eb58163 commit 82d6801
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wp-tevko-responsive-images.php
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ function tevkori_filter_content_images_callback( $matches ) {
if ( false !== strpos( 'srcset="', $atts ) ) {

// Get the url of the original image.
preg_match( '/src="(.+?)(\-([0-9]+)x([0-9]+))?(\.\w{3,4})"/i', $atts, $url_matches );
preg_match( '/src="(.+?)(\-([0-9]+)x([0-9]+))?(\.[a-zA-Z]{3,4})"/i', $atts, $url_matches );

$url = $url_matches[1] . $url_matches[5];

Expand Down

0 comments on commit 82d6801

Please sign in to comment.