aboutsummaryrefslogtreecommitdiffstats
path: root/include/oembed.php
diff options
context:
space:
mode:
authorHaakon Meland Eriksen <haakon.eriksen@far.no>2016-02-05 06:28:52 +0100
committerHaakon Meland Eriksen <haakon.eriksen@far.no>2016-02-05 06:28:52 +0100
commit2afdba48f06bb99922c19bf964d8f601c1545166 (patch)
treebbd1418a44cee6306a568bb64f4caa2d93eeb289 /include/oembed.php
parent8f810a3dcfd60c00b14d3da811e1c0cf005e8ced (diff)
parent425089524373137e11d3691e7efdce0fb89281c8 (diff)
downloadvolse-hubzilla-2afdba48f06bb99922c19bf964d8f601c1545166.tar.gz
volse-hubzilla-2afdba48f06bb99922c19bf964d8f601c1545166.tar.bz2
volse-hubzilla-2afdba48f06bb99922c19bf964d8f601c1545166.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include/oembed.php')
-rwxr-xr-xinclude/oembed.php28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/oembed.php b/include/oembed.php
index 7c577b6c2..cac0154f6 100755
--- a/include/oembed.php
+++ b/include/oembed.php
@@ -3,6 +3,34 @@ function oembed_replacecb($matches){
$embedurl=$matches[1];
+
+ // site white/black list
+
+ if(($x = get_config('system','embed_deny'))) {
+ $l = explode("\n",$x);
+ if($l) {
+ foreach($l as $ll) {
+ if(trim($ll) && strpos($embedurl,trim($ll)) !== false)
+ return '<a href="' . $embedurl . '">' . $embedurl . '</a>';
+ }
+ }
+ }
+ if(($x = get_config('system','embed_allow'))) {
+ $found = false;
+ $l = explode("\n",$x);
+ if($l) {
+ foreach($l as $ll) {
+ if(trim($ll) && strpos($embedurl,trim($ll)) !== false) {
+ $found = true;
+ break;
+ }
+ }
+ }
+ if(! $found) {
+ return '<a href="' . $embedurl . '">' . $embedurl . '</a>';
+ }
+ }
+
// implements a personal embed white/black list for logged in members
if(local_channel()) {
if(($x = get_pconfig(local_channel(),'system','embed_deny'))) {