Skip to content

Commit 769ac68

Browse files
committed
[facebook spouts] Switched to HTTP when HTTPS not available
1 parent e7a5a79 commit 769ac68

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

spouts/facebook/page.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,13 @@ public function load($params) {
8888
* @param mixed $params params for the source
8989
*/
9090
public function getXmlUrl($params) {
91-
$content = @file_get_contents("https://graph.facebook.com/" . urlencode($params['user']));
91+
$protocol = "http://";
92+
if (version_compare(PHP_VERSION, "5.3.0") >= 0 && defined("OPENSSL_VERSION_NUMBER")) {
93+
$protocol = "https://";
94+
}
95+
$content = @file_get_contents($protocol . "graph.facebook.com/" . urlencode($params['user']));
9296
$data = json_decode($content, TRUE);
9397

94-
return "https://www.facebook.com/feeds/page.php?format=atom10&id=" . $data['id'];
98+
return $protocol . "www.facebook.com/feeds/page.php?format=atom10&id=" . $data['id'];
9599
}
96100
}

0 commit comments

Comments
 (0)