Merge pull request #4167 from MrPetovan/bug/4155-remove-proxy-oembed

Add settings for OEmbed
This commit is contained in:
Michael Vogel 2018-01-04 20:57:27 +01:00 committed by GitHub
commit c938623a3d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 68 additions and 28 deletions

View file

@ -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';

View file

@ -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;
}

View file

@ -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";