aboutsummaryrefslogtreecommitdiffstats
path: root/include/oembed.php
diff options
context:
space:
mode:
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);