markjaquith / WP-Stack

A toolkit for creating professional WordPress deployments
1.11k stars 123 forks source link

Protocol relative URLs break RSS based email campaigns #29

Open clifgriffin opened 9 years ago

clifgriffin commented 9 years ago

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.