Skip to content
Permalink
Browse files

fix: better replacement for relative paths

  • Loading branch information...
preda-bogdan authored and selul committed May 24, 2019
1 parent 4ec00fb commit c18be2ff024e209cf729923802ac6b1f34d0a257
Showing with 11 additions and 1 deletion.
  1. +11 −1 inc/tag_replacer.php
@@ -78,7 +78,17 @@ public function process_image_tags( $content, $images = array() ) {
$src = $tmp = untrailingslashit( $this->upload_resource['content_host'] ) . $src;
$new_src = $is_slashed ? addcslashes( $src, '/' ) : $src;
$image_tag = str_replace( $images['img_url'][ $index ], $new_src, $image_tag );
$image_tag = str_replace(
array(
'"' . $images['img_url'][ $index ] . '"',
"'" . $images['img_url'][ $index ] . "'",
),
array(
'"' . $new_src . '"',
"'" . $new_src . "''",
),
$image_tag
);
$images['img_url'][ $index ] = $new_src;
}

0 comments on commit c18be2f

Please sign in to comment.
You can’t perform that action at this time.