Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

https feeds #117

Closed
Jean-Jacques opened this Issue Feb 10, 2011 · 1 comment

Comments

Projects
None yet
2 participants

Hi,

In SimplePie 1.2, SSL connections through fsockopen use a special value for hostname (ssl://hostname). This value is reused for HTTP Host header later on, resulting in an HTTP error from server. Error message in SimplePie is: ‘This XML document is invalid, likely due to invalid characters. XML error: SYSTEM or PUBLIC, the URI is missing at line 1, column…’

This patch corrects it:

--- simplepie.inc.old   2011-02-10 12:53:00.000000000 +0100
+++ simplepie.inc   2011-02-10 15:45:31.000000000 +0100
@@ -7733,14 +7733,15 @@
                $url_parts = parse_url($url);
                if (isset($url_parts['scheme']) && strtolower($url_parts['scheme']) === 'https')
                {
-                   $url_parts['host'] = "ssl://$url_parts[host]";
+                   $fsock_host = "ssl://$url_parts[host]";
                    $url_parts['port'] = 443;
                }
                if (!isset($url_parts['port']))
                {
+                   $fsock_host = $url_parts['host'];
                    $url_parts['port'] = 80;
                }
-               $fp = @fsockopen($url_parts['host'], $url_parts['port'], $errno, $errstr, $timeout);
+               $fp = @fsockopen($fsock_host, $url_parts['port'], $errno, $errstr, $timeout);
                if (!$fp)
                {
                    $this->error = 'fsockopen error: ' . $errstr;

@rmccue rmccue closed this in 73bfb71 Jun 1, 2011

Contributor

rmccue commented Jun 1, 2011

Fixed on one-dot-two in 8402bb2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment