]> source.dussan.org Git - nextcloud-server.git/commitdiff
apps/bookmarks: use curl instead of file_get_contents
authorFlorian Pritz <bluewind@xinu.at>
Fri, 23 Sep 2011 10:49:14 +0000 (12:49 +0200)
committerFlorian Pritz <bluewind@xinu.at>
Sat, 24 Sep 2011 16:41:57 +0000 (18:41 +0200)
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

index aee941a27b95ea69e2526512bd612e127c9c9221..d674e595a80f26b76d52fdf216a0911c85b34525 100644 (file)
@@ -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]);