Skip to content

Commit 980fcef

Browse files
committed
fix: image url replacement on custom WordPress directory structure, fixes #79, thanks @hackles for reporting
1 parent 6932302 commit 980fcef

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

inc/app_replacer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ public function set_properties() {
231231
'directory' => $upload_data['basedir'],
232232
);
233233
$this->upload_resource['url_length'] = strlen( $this->upload_resource['url'] );
234-
$this->upload_resource['content_path'] = str_replace( get_site_url(), '', content_url() );
234+
$this->upload_resource['content_path'] = str_replace( get_home_url(), '', content_url() );
235235

236236
$service_data = $this->settings->get( 'service_data' );
237237

inc/tag_replacer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function process_image_tags( $content, $images = array() ) {
7474

7575
$src = $tmp = $is_slashed ? stripslashes( $images['img_url'][ $index ] ) : $images['img_url'][ $index ];
7676

77-
$src = $tmp = strpos( $src, $this->upload_resource['content_path'] ) === 0 ? untrailingslashit( get_site_url() ) . $src : $src;
77+
$src = $tmp = strpos( $src, $this->upload_resource['content_path'] ) === 0 ? untrailingslashit( get_home_url() ) . $src : $src;
7878

7979
if ( apply_filters( 'optml_ignore_image_link', false, $src ) ||
8080
false !== strpos( $src, Optml_Config::$service_url ) ||

0 commit comments

Comments
 (0)