aboutsummaryrefslogtreecommitdiffstats
path: root/include/oembed.php
diff options
context:
space:
mode:
authorfabrixxm <fabrix.xm@gmail.com>2011-08-17 17:35:37 +0200
committerfabrixxm <fabrix.xm@gmail.com>2011-08-17 17:35:37 +0200
commitbdf42473a0341f291cd256323d122aa80bb0cb0b (patch)
tree922a5ba24a34d7ea89673019e82f68436edb7091 /include/oembed.php
parent6c423feed2d8bc5bd36d2a1cbac073915e523749 (diff)
parentdb03b1ab173d61b1ee75271dac1e48f3475ad42c (diff)
downloadvolse-hubzilla-bdf42473a0341f291cd256323d122aa80bb0cb0b.tar.gz
volse-hubzilla-bdf42473a0341f291cd256323d122aa80bb0cb0b.tar.bz2
volse-hubzilla-bdf42473a0341f291cd256323d122aa80bb0cb0b.zip
Merge remote-tracking branch 'friendika/master' into newui
Diffstat (limited to 'include/oembed.php')
-rw-r--r--include/oembed.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/oembed.php b/include/oembed.php
index 06a37d8e4..06f71a3b3 100644
--- a/include/oembed.php
+++ b/include/oembed.php
@@ -7,6 +7,7 @@ function oembed_replacecb($matches){
function oembed_fetch_url($embedurl){
+
$r = q("SELECT v FROM `cache` WHERE k='%s'",
dbesc($embedurl));
@@ -16,7 +17,10 @@ function oembed_fetch_url($embedurl){
$txt = "";
// try oembed autodiscovery
- $html_text = fetch_url($embedurl);
+ $redirects = 0;
+ $html_text = fetch_url($embedurl, false, $redirects, 15);
+ if(! $html_text)
+ return;
$dom = @DOMDocument::loadHTML($html_text);
if ($dom){
$xpath = new DOMXPath($dom);