Skip to content

Commit 68531fc

Browse files
committed
Fix issues with postimages
1 parent 1bf3149 commit 68531fc

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

class.jetpack-post-images.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -200,12 +200,12 @@ static function from_attachment( $post_id, $width = 200, $height = 200 ) {
200200
foreach( $html_images as $html_image ) {
201201
$src = parse_url( $html_image['src'] );
202202
// strip off any query strings from src
203-
if( ! empty($src['scheme']) && ! empty($src['host']) ) {
203+
if( ! empty( $src['scheme'] ) && ! empty( $src['host'] ) ) {
204204
$inserted_images[] = $src['scheme'] . '://' . $src['host'] . $src['path'];
205-
} elseif( ! empty($src['host']) ) {
206-
$inserted_images[] = '//' . $src['host'] . $src['path'];
205+
} elseif( ! empty( $src['host'] ) ) {
206+
$inserted_images[] = set_url_scheme( 'http://' . $src['host'] . $src['path'] );
207207
} else {
208-
$inserted_images[] = WP_HOME . $src['path'];
208+
$inserted_images[] = site_url( '/' ) . $src['path'];
209209
}
210210
}
211211
foreach( $images as $i => $image ) {

0 commit comments

Comments
 (0)