mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-16 20:05:14 +02:00
Merge pull request #4167 from MrPetovan/bug/4155-remove-proxy-oembed
Add settings for OEmbed
This commit is contained in:
commit
c938623a3d
11 changed files with 68 additions and 28 deletions
|
@ -3,7 +3,6 @@
|
|||
* @file include/items.php
|
||||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\ParseUrl;
|
||||
use Friendica\Content\Feature;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\PConfig;
|
||||
|
@ -18,6 +17,7 @@ use Friendica\Object\Image;
|
|||
use Friendica\Protocol\DFRN;
|
||||
use Friendica\Protocol\OStatus;
|
||||
use Friendica\Protocol\Feed;
|
||||
use Friendica\Util\ParseUrl;
|
||||
|
||||
require_once 'include/bbcode.php';
|
||||
require_once 'include/tags.php';
|
||||
|
|
|
@ -615,24 +615,37 @@ function allowed_email($email)
|
|||
return false;
|
||||
}
|
||||
|
||||
$str_allowed = Config::get('system', 'allowed_email');
|
||||
if (! $str_allowed) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$found = false;
|
||||
|
||||
$fnmatch = function_exists('fnmatch');
|
||||
$str_allowed = Config::get('system', 'allowed_email', '');
|
||||
$allowed = explode(',', $str_allowed);
|
||||
|
||||
if (count($allowed)) {
|
||||
foreach ($allowed as $a) {
|
||||
$pat = strtolower(trim($a));
|
||||
if (($fnmatch && fnmatch($pat, $domain)) || ($pat == $domain)) {
|
||||
return allowed_domain($domain, $allowed);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks for the existence of a domain in a domain list
|
||||
*
|
||||
* If strict is not set, an empty domain list counts as found
|
||||
*
|
||||
* @brief Checks for the existence of a domain in a domain list
|
||||
* @param string $domain
|
||||
* @param array $domain_list
|
||||
* @param bool $strict
|
||||
* @return boolean
|
||||
*/
|
||||
function allowed_domain($domain, array $domain_list, $strict = false)
|
||||
{
|
||||
$found = false;
|
||||
|
||||
if (count($domain_list)) {
|
||||
foreach ($domain_list as $item) {
|
||||
$pat = strtolower(trim($item));
|
||||
if (fnmatch($pat, $domain) || ($pat == $domain)) {
|
||||
$found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} elseif(!$strict) {
|
||||
$found = true;
|
||||
}
|
||||
return $found;
|
||||
}
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
* @file include/plaintext.php
|
||||
*/
|
||||
use Friendica\App;
|
||||
use Friendica\ParseUrl;
|
||||
use Friendica\Core\PConfig;
|
||||
use Friendica\Object\Image;
|
||||
use Friendica\Util\ParseUrl;
|
||||
|
||||
require_once "include/bbcode.php";
|
||||
require_once "include/html2plain.php";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue