mirror of
https://github.com/owncloud/bookmarks.git
synced 2025-01-18 14:52:10 +01:00
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>
This commit is contained in:
parent
619ff59236
commit
a36d38f2e4
@ -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]);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user