summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2011-09-23 12:49:14 +0200
committerFlorian Pritz <bluewind@xinu.at>2011-09-24 18:41:57 +0200
commitd7c165eb358411135647c93a47e3496477d1b4e5 (patch)
treea26f62e388e5f43b36e86e252de0859667b8fb31 /apps
parent934b18405a7991eeb1e9ec7606f0d3c322c1482b (diff)
downloadnextcloud-server-d7c165eb358411135647c93a47e3496477d1b4e5.tar.gz
nextcloud-server-d7c165eb358411135647c93a47e3496477d1b4e5.zip
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>
Diffstat (limited to 'apps')
-rw-r--r--apps/bookmarks/bookmarksHelper.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/bookmarks/bookmarksHelper.php b/apps/bookmarks/bookmarksHelper.php
index aee941a27b9..d674e595a80 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]);