summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-02-11 15:50:26 +0100
committerErich Eckner <git@eckner.net>2019-02-11 15:50:26 +0100
commit55cabb0d30c7e1b59183a1d7145edc800fca16ab (patch)
treeebb8c3b5953e6d9edd7be496fb39fb3e3c50ed5e /index.php
parentbf9d9aae17cfd5c3c314356d489cacca7ab86e68 (diff)
downloadarchweb32-55cabb0d30c7e1b59183a1d7145edc800fca16ab.tar.xz
index.php: access news.archlinux32.org via IPv4 - it times out on IPv6upstream-lookalike
Diffstat (limited to 'index.php')
-rw-r--r--index.php10
1 files changed, 7 insertions, 3 deletions
diff --git a/index.php b/index.php
index d550258..3454e50 100644
--- a/index.php
+++ b/index.php
@@ -70,9 +70,13 @@ print_header("", "home");
<a href="https://news.archlinux32.org/rss.php" title="Arch 32 News RSS Feed" class="rss-icon"><img width="16" height="16" src="/static/rss.c5ebdc5318d6.png" alt="RSS Feed" /></a>
<?php
-$news = simplexml_load_string(
- file_get_contents("https://news.archlinux32.org/rss.php")
-);
+$ch = curl_init("https://news.archlinux32.org/rss.php");
+curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+$news = curl_exec($ch);
+curl_close($ch);
+
+$news = simplexml_load_string($news);
if ($news === false) {