[Plugin: Amazon S3 for WordPress] option_siteurl gets wrong url when multisite with subdomain and su
-
Hi, I’m using this plugin and it works very good, but I have encountered a tricky problem.
I have installed WP with multisite and it is on subdomain. Plus, the WP is working on subdirectory. Like:https://example.com/blog/ https://foo.example.com/blog/
The main blog has no problem to upload s3, it dug s3://bucketname/blog/wp-contents/2011/11/xxxx.jpg .
But the sub blog is different. It should be uploaded to s3://bucketname/blog/files/2011/11/xxxx.jpg , but it dug s3://bucketname/blog//blog/files/2011/11/xxxx.jpg .
I looked into the code, and found the wrong code, but it seems the code did it intentionally, and I don’t understand why.
In class-plugin.php, why this filter option_siteurl before getting $uploadDIr. It mess the information. In line 173,add_filter('option_siteurl', array(&$this, 'upload_path'));
I also checked upload_path function, but it does not make any sense to filter option_siteurl to upload_path.
After removing the add_filter line, it worked like a charm, but I think there should be some reason to filter option-siteurl. It saids “figure out the correct path to upload to, for wordpress mu installs”, but it does make incorrect path…
Hmm….
- The topic ‘[Plugin: Amazon S3 for WordPress] option_siteurl gets wrong url when multisite with subdomain and su’ is closed to new replies.