From d7c165eb358411135647c93a47e3496477d1b4e5 Mon Sep 17 00:00:00 2001
From: Florian Pritz <bluewind@xinu.at>
Date: Fri, 23 Sep 2011 12:49:14 +0200
Subject: [PATCH] apps/bookmarks: use curl instead of file_get_contents

Don't depend on allow_url_fopen being enabled when we already use curl
elsewhere in the code.

Signed-off-by: Florian Pritz <bluewind@xinu.at>
---
 apps/bookmarks/bookmarksHelper.php | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/apps/bookmarks/bookmarksHelper.php b/apps/bookmarks/bookmarksHelper.php
index aee941a27b..d674e595a8 100644
--- a/apps/bookmarks/bookmarksHelper.php
+++ b/apps/bookmarks/bookmarksHelper.php
@@ -9,7 +9,12 @@ function getURLMetadata($url) {
 	} 
 	$metadata['url'] = $url;
 
-	$page = file_get_contents($url);
+	$ch = curl_init();
+	curl_setopt($ch, CURLOPT_URL, $url);
+	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+	$page = curl_exec($ch);
+	curl_close($ch);
+
 	@preg_match( "/<title>(.*)<\/title>/si", $page, $match );
 	$metadata['title'] = htmlspecialchars_decode(@$match[1]); 
 
-- 
GitLab