@ericna Did you found a solution yet?
We have the same issue, exactly as you describe.
Hi ,
I got the same issue with new aws plugins in our multisite environment.
I have updated both “amazon-s3-and-cloudfront” and “amazon-web-services”
and found the same issue which you guys found but in only one post type related with email in our system.
what i did to fix that is commented one function call in below file :
wp-content/plugins/amazon-s3-and-cloudfront/classes/as3cf-filter.php
function name : find_urls_and_replace
and commented code in this function. : //$value = $this->replace_urls( $value, $url_pairs );
I still have one issue left with this new plugin when I share post between two stations , image in child station comes busted I am still working on that but you guys can try above thing and do fresh test and see if that works
for you guys.
Thanks,
Dipak.
We had a similar situation in which images hosted on third party websites had their urls re-rewritten by this plugin instead of being left alone. I understand this is not your particular issue but you may edit as3cf-filter.php and create your own code to check for your particular condition and override it. Others might find it useful. This page lead me to the correct file to edit.
What we did was add the following:
protected function should_process_host($url_found, $url_wp){
$src_host_names = explode(".", parse_url($url_found, PHP_URL_HOST));
$src_host_names = array_slice($src_host_names, -2);
$src_host_names = implode('.', $src_host_names);
$wp_host_name = explode(".", parse_url($url_wp, PHP_URL_HOST));
$wp_host_name = array_slice($wp_host_name, -2);
$wp_host_name = implode('.', $wp_host_name);
if ($src_host_names !== $wp_host_name) {
// OR if(strpos($wp_host_name, $src_host_names))
return false;
}
}
Then add:
if (!$this->should_process_host($url, get_site_url())) {
// URL is foreign, skip
continue;
}
within the “foreach ($matches as $url)” loop in:
get_urls_from_content
get_urls_from_img_src
You may want to adjust “-2” on array_splice depending on how ‘deep’ you need to host comparison.
The fix is not ideal because it will get overwritten on each update.
[Moderator note: code fixed. Please wrap code in the backtick character or use the code button.]
-
This reply was modified 8 years, 3 months ago by
bdbrown.
-
This reply was modified 8 years, 3 months ago by
bdbrown.
-
This reply was modified 8 years, 3 months ago by
bdbrown.