markjaquith/WP-Stack

Protocol relative URLs break RSS based email campaigns

clifgriffin opened this issue · 0 comments

Many sites feed MailChimp or similar via the RSS feed.

Protocol relative URLs to images break many email clients, including Gmail and Outlook.

To fix this I changed the main filter to:

return preg_replace( "#=([\"'])(https?:)(//{$this->site_domain})?/([^/](?:(?!\\1).)+)\.(" . implode( '|', $this->extensions ) . ")(\?((?:(?!\\1).)+))?\\1#", '=$1$2//' . $this->cdn_domain . '/$4.$5$6$1', $content );

This could be an option, or it could just be the default until relative protocol URLs are more broadly supported.