From: Antonio Ospite Date: Sat, 28 Feb 2015 00:43:41 +0000 (+0100) Subject: tweeper.php: fix validation when generating enclosure elements X-Git-Tag: v0.4~35 X-Git-Url: https://git.ao2.it/tweeper.git/commitdiff_plain/547175cc33bb2aa612c706eac783d8f506fe9e7e tweeper.php: fix validation when generating enclosure elements The RSS specification says that the enclosure element url must be http. See http://sourceforge.net/p/feedvalidator/bugs/72/ So follow the specification, for now. If feedvalidator decides to relax this requirement this hack will be removed. --- diff --git a/tweeper.php b/tweeper.php index 524928a..d084398 100644 --- a/tweeper.php +++ b/tweeper.php @@ -96,7 +96,11 @@ class Tweeper { "video/ogg", ); - $url_info = Tweeper::get_info($url); + // The RSS specification says that the enclosure element url must be http. + // See http://sourceforge.net/p/feedvalidator/bugs/72/ + $http_url = preg_replace("/^https/", "http", $url); + + $url_info = Tweeper::get_info($http_url); $supported = in_array($url_info['content_type'], $supported_content_types); if (!$supported) {