aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorfabrixxm <fabrix.xm@gmail.com>2011-05-22 23:06:47 +0200
committerFabio Comuni <fabrix.xm@gmail.com>2011-05-23 09:14:57 +0200
commitef64c5187df80da2065655726b8d05a9ce6b0e0a (patch)
tree6415d726afe1b6fd86b86ae63c461fd6f2370563 /mod
parent072e4146369ae8ec10af961b7e1b25dc491e8f07 (diff)
downloadvolse-hubzilla-ef64c5187df80da2065655726b8d05a9ce6b0e0a.tar.gz
volse-hubzilla-ef64c5187df80da2065655726b8d05a9ce6b0e0a.tar.bz2
volse-hubzilla-ef64c5187df80da2065655726b8d05a9ce6b0e0a.zip
add config [system][embed_all] to use oembed with links and youtube. Url parse fallback to default if url has not an oembed rappresentation.
Diffstat (limited to 'mod')
-rw-r--r--mod/parse_url.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/mod/parse_url.php b/mod/parse_url.php
index 30371e9f6..8e1684732 100644
--- a/mod/parse_url.php
+++ b/mod/parse_url.php
@@ -1,7 +1,7 @@
<?php
require_once('library/HTML5/Parser.php');
-
+require_once('include/oembed.php');
function parse_url_content(&$a) {
@@ -25,9 +25,18 @@ function parse_url_content(&$a) {
killme();
}
- if($url)
+ if($url) {
+ // fetch link with oembed
+ if ($a->config['system']['embed_all']){
+ $j = oembed_fetch_url($url);
+ if ($j->type!="error"){
+ echo oembed_format_object($j);
+ killme();
+ }
+ }
+
$s = fetch_url($url);
- else {
+ } else {
echo '';
killme();
}