debian/control: remove unnecessary versioned dependency on pkg-php-tools
[tweeper.git] / src / rss_converter_dilbert.com.xsl
index 88e7155..94d7fef 100644 (file)
@@ -36,6 +36,9 @@
     xmlns:php="http://php.net/xsl"
     exclude-result-prefixes="php">
 
+    <xsl:param name="generate-enclosure"/>
+    <xsl:param name="show-multimedia"/>
+
     <xsl:output method="xml" indent="yes"/>
 
     <xsl:variable name="BaseURL" select="//meta[@property='og:url']/@content"/>
             </pubDate>
             <description>
                 <xsl:text disable-output-escaping="yes">&lt;![CDATA[</xsl:text>
-                <img src="{$picture-url}" alt="{$picture-title}"/>
+                <xsl:if test="$show-multimedia = 1">
+                    <img src="{$picture-url}" alt="{$picture-title}"/>
+                </xsl:if>
                 <xsl:text disable-output-escaping="yes">]]&gt;</xsl:text>
             </description>
             <xsl:if test="$generate-enclosure = 1">
-                <xsl:copy-of select="php:functionString('Tweeper\Tweeper::generateEnclosure', $picture-url)"/>
+                <!--
+                    Dilbert.com uses protocol-relative urls for pictures but
+                    generateEnclosure() relies on curl which cannot work
+                    without a schema.
+
+                    Use http as protocol because curl gives some error when
+                    attempting TLS negotiation with the server where
+                    Dilbert.com assets are.
+                -->
+                <xsl:copy-of select="php:functionString('Tweeper\Tweeper::generateEnclosure', concat('http:', $picture-url))"/>
             </xsl:if>
         </item>
     </xsl:template>