mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 00:35:30 +00:00
add system black/white list for embeds ahead of personal config
This commit is contained in:
parent
18208fab84
commit
40b00ab362
1 changed files with 28 additions and 0 deletions
|
@ -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'))) {
|
||||
|
|
Loading…
Reference in a new issue