Problem with absolute image path
-
Hi, I used this plugin on my site (local server) and everything worked like a charm. However, when I migrated my site to a web server, the images path was wrong, cause they were saved on DB with the absolute path of my local server.
I checked the plugin code and it’s too easy to solve, however I’d like you to update this change (if possible) so I won’t have to hack the plugin, having in mind that this issue could be a common problem when a site using this plugin need to be migrated to another server.
In line 212 I removed $imgurl[“host”] from the $imgsrc variable, so its now:
$imgsrc=$imgurl[“path”];Next I replaced the line 215 this way:
Before:
echo ‘<img src=”//’.$imgsrc.'” alt=”‘.esc_attr($$alt).'”>’;
Now:
echo ‘<img src=”‘.$imgsrc.'” alt=”‘.esc_attr($$alt).'”>’;And that solved my problem, I hope you can merge this fix into the original plugin.
- The topic ‘Problem with absolute image path’ is closed to new replies.