mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-21 00:52:33 -04:00
Deprecate *_config() functions in core.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?php /** @file */
|
||||
|
||||
use Zotlabs\Lib\Cache;
|
||||
|
||||
use Zotlabs\Lib\Config;
|
||||
|
||||
function oembed_replacecb($matches){
|
||||
|
||||
@@ -28,7 +28,7 @@ function oembed_action($embedurl) {
|
||||
logger('oembed_action: ' . $embedurl, LOGGER_DEBUG, LOG_INFO);
|
||||
|
||||
if(strpos($embedurl,'http://') === 0) {
|
||||
if(intval(get_config('system','embed_sslonly'))) {
|
||||
if(intval(Config::Get('system','embed_sslonly'))) {
|
||||
$action = 'block';
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,7 @@ function oembed_action($embedurl) {
|
||||
|
||||
// site white/black list
|
||||
|
||||
if(($x = get_config('system','embed_deny'))) {
|
||||
if(($x = Config::Get('system','embed_deny'))) {
|
||||
if(($x) && (! is_array($x)))
|
||||
$x = explode("\n",$x);
|
||||
if($x) {
|
||||
@@ -55,7 +55,7 @@ function oembed_action($embedurl) {
|
||||
|
||||
$found = false;
|
||||
|
||||
if(($x = get_config('system','embed_allow'))) {
|
||||
if(($x = Config::Get('system','embed_allow'))) {
|
||||
if(($x) && (! is_array($x)))
|
||||
$x = explode("\n",$x);
|
||||
if($x) {
|
||||
@@ -139,16 +139,16 @@ function oembed_fetch_url($embedurl){
|
||||
// we should try to cache this and avoid a lookup on each render
|
||||
$is_matrix = is_matrix_url($embedurl);
|
||||
|
||||
$zrl = ((get_config('system','oembed_zrl')) ? $is_matrix : false);
|
||||
$zrl = ((Config::Get('system','oembed_zrl')) ? $is_matrix : false);
|
||||
|
||||
$furl = ((local_channel() && $zrl) ? zid($embedurl) : $embedurl);
|
||||
|
||||
if($action !== 'block' && (! get_config('system','oembed_cache_disable'))) {
|
||||
if($action !== 'block' && (! Config::Get('system','oembed_cache_disable'))) {
|
||||
$txt = Cache::get('[' . App::$videowidth . '] ' . $furl);
|
||||
}
|
||||
|
||||
|
||||
if(strpos(strtolower($embedurl),'.pdf') !== false && get_config('system','inline_pdf')) {
|
||||
if(strpos(strtolower($embedurl),'.pdf') !== false && Config::Get('system','inline_pdf')) {
|
||||
$action = 'allow';
|
||||
$j = [
|
||||
'html' => '<object data="' . $embedurl . '" type="application/pdf" style="width: 100%; height: 300px;"></object>',
|
||||
@@ -164,7 +164,7 @@ function oembed_fetch_url($embedurl){
|
||||
$txt = EMPTY_STR;
|
||||
|
||||
if ($action !== 'block') {
|
||||
$max_oembed_size = get_config('system', 'oembed_max_size', 1 * 1024 * 1024 /* 1MB */);
|
||||
$max_oembed_size = Config::Get('system', 'oembed_max_size', 1 * 1024 * 1024 /* 1MB */);
|
||||
|
||||
stream_context_set_default(
|
||||
[
|
||||
@@ -259,7 +259,7 @@ function oembed_fetch_url($embedurl){
|
||||
|
||||
// save in cache
|
||||
|
||||
if(! get_config('system','oembed_cache_disable'))
|
||||
if(! Config::Get('system','oembed_cache_disable'))
|
||||
Cache::set('[' . App::$videowidth . '] ' . $furl, $txt);
|
||||
|
||||
}
|
||||
@@ -429,7 +429,7 @@ function oembed_iframe($src,$width,$height) {
|
||||
|
||||
|
||||
function oembed_bbcode2html($text){
|
||||
$stopoembed = get_config("system","no_oembed");
|
||||
$stopoembed = Config::Get("system","no_oembed");
|
||||
if ($stopoembed == true){
|
||||
return preg_replace("/\[embed\](.+?)\[\/embed\]/is", "<!-- oembed $1 --><i>". t('Embedding disabled') ." : $1</i><!-- /oembed $1 -->" ,$text);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user