add system black/white list for embeds ahead of personal config
This commit is contained in:
parent
18208fab84
commit
40b00ab362
@ -3,6 +3,34 @@ function oembed_replacecb($matches){
|
|||||||
|
|
||||||
$embedurl=$matches[1];
|
$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
|
// implements a personal embed white/black list for logged in members
|
||||||
if(local_channel()) {
|
if(local_channel()) {
|
||||||
if(($x = get_pconfig(local_channel(),'system','embed_deny'))) {
|
if(($x = get_pconfig(local_channel(),'system','embed_deny'))) {
|
||||||
|
Reference in New Issue
Block a user