diff --git a/tantan/wordpress-s3/class-plugin.php b/tantan/wordpress-s3/class-plugin.php index 88b57b2..d9c71f2 100644 --- a/tantan/wordpress-s3/class-plugin.php +++ b/tantan/wordpress-s3/class-plugin.php @@ -244,9 +244,18 @@ class TanTanWordPressS3Plugin { if ($current_blog->path == '/' && ($current_blog->blog_id != 1)) { $dir = substr($current_blog->domain, 0, strpos($current_blog->domain, '.')); } else { - $dir = trim($current_blog->path, '/'); + // prepend a directory onto the path for vhosted blogs + if (constant("VHOST") != 'yes') { + $dir = ''; + } else { + $dir = $current_blog->path; + } } - return $path.'/'.$dir; + //echo trim($path.'/'.$dir, '/'); + if ($path == '') { + $path = $current_blog->path; + } + return trim($path.'/'.$dir, '/'); } function wp_get_attachment_url($url, $postID) { if (!$this->options) $this->options = get_option('tantan_wordpress_s3');