Merge branch '2021.03-rc' into copyright-2021
This commit is contained in:
commit
befc2af504
22 changed files with 41829 additions and 40547 deletions
|
|
@ -86,7 +86,7 @@ class JitConfig extends BaseConfig
|
|||
$dbvalue = $this->configModel->get($cat, $key);
|
||||
|
||||
if (isset($dbvalue)) {
|
||||
$this->configCache->set($cat, $key, $dbvalue);
|
||||
$this->configCache->set($cat, $key, $dbvalue, Cache::SOURCE_DB);
|
||||
unset($dbvalue);
|
||||
}
|
||||
|
||||
|
|
@ -105,7 +105,7 @@ class JitConfig extends BaseConfig
|
|||
public function set(string $cat, string $key, $value)
|
||||
{
|
||||
// set the cache first
|
||||
$cached = $this->configCache->set($cat, $key, $value);
|
||||
$cached = $this->configCache->set($cat, $key, $value, Cache::SOURCE_DB);
|
||||
|
||||
// If there is no connected adapter, we're finished
|
||||
if (!$this->configModel->isConnected()) {
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ class PreloadConfig extends BaseConfig
|
|||
if ($this->configModel->isConnected()) {
|
||||
$config = $this->configModel->get($cat, $key);
|
||||
if (isset($config)) {
|
||||
$this->configCache->set($cat, $key, $config);
|
||||
$this->configCache->set($cat, $key, $config, Cache::SOURCE_DB);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -102,7 +102,7 @@ class PreloadConfig extends BaseConfig
|
|||
}
|
||||
|
||||
// set the cache first
|
||||
$cached = $this->configCache->set($cat, $key, $value);
|
||||
$cached = $this->configCache->set($cat, $key, $value, Cache::SOURCE_DB);
|
||||
|
||||
// If there is no connected adapter, we're finished
|
||||
if (!$this->configModel->isConnected()) {
|
||||
|
|
@ -133,4 +133,18 @@ class PreloadConfig extends BaseConfig
|
|||
|
||||
return $cacheRemoved || $storeRemoved;
|
||||
}
|
||||
|
||||
public function testSetDouble()
|
||||
{
|
||||
$this->configModel->shouldReceive('isConnected')
|
||||
->andReturn(true);
|
||||
|
||||
// constructor loading
|
||||
$this->configModel->shouldReceive('load')
|
||||
->with('config')
|
||||
->andReturn(['config' => ['test' => 'it']])
|
||||
->once();
|
||||
|
||||
parent::testSetDouble();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -133,9 +133,9 @@ class Installer
|
|||
$returnVal = false;
|
||||
}
|
||||
|
||||
if (!$this->checkHtAccess($baseurl)) {
|
||||
$returnVal = false;
|
||||
}
|
||||
/// @TODO This check should not block installations because of containerization issues
|
||||
/// @see https://github.com/friendica/docker/issues/134
|
||||
$this->checkHtAccess($baseurl);
|
||||
|
||||
return $returnVal;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,8 +95,7 @@ class Invite extends BaseModule
|
|||
$nmessage = $message;
|
||||
}
|
||||
|
||||
$additional_headers = 'From: ' . $app->user['email'] . "\n"
|
||||
. 'Sender: ' . DI::emailer()->getSiteEmailAddress() . "\n"
|
||||
$additional_headers = 'From: "' . $app->user['email'] . '" <' . DI::emailer()->getSiteEmailAddress() . ">\n"
|
||||
. 'Content-type: text/plain; charset=UTF-8' . "\n"
|
||||
. 'Content-transfer-encoding: 8bit';
|
||||
|
||||
|
|
|
|||
|
|
@ -1330,7 +1330,7 @@ class Transmitter
|
|||
return $match[0];
|
||||
}
|
||||
|
||||
return '[url=' . ($data['alias'] ?: $data['url']) . ']@' . $data['nick'] . '[/url]';
|
||||
return '[url=' . $data['url'] . ']@' . $data['nick'] . '[/url]';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -103,6 +103,28 @@ abstract class AbstractLogger implements LoggerInterface
|
|||
return strtr($message, $replace);
|
||||
}
|
||||
|
||||
/**
|
||||
* JSON Encodes an complete array including objects with "__toString()" methods
|
||||
*
|
||||
* @param array $input an Input Array to encode
|
||||
*
|
||||
* @return false|string The json encoded output of the array
|
||||
*/
|
||||
protected function jsonEncodeArray(array $input)
|
||||
{
|
||||
$output = [];
|
||||
|
||||
foreach ($input as $key => $value) {
|
||||
if (method_exists($value, '__toString')) {
|
||||
$output[$key] = $value->__toString();
|
||||
} else {
|
||||
$output[$key] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
return @json_encode($output);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -161,8 +161,8 @@ class StreamLogger extends AbstractLogger
|
|||
$logMessage .= $this->channel . ' ';
|
||||
$logMessage .= '[' . strtoupper($level) . ']: ';
|
||||
$logMessage .= $this->psrInterpolate($message, $context) . ' ';
|
||||
$logMessage .= @json_encode($context) . ' - ';
|
||||
$logMessage .= @json_encode($record);
|
||||
$logMessage .= $this->jsonEncodeArray($context) . ' - ';
|
||||
$logMessage .= $this->jsonEncodeArray($record);
|
||||
$logMessage .= PHP_EOL;
|
||||
|
||||
return $logMessage;
|
||||
|
|
|
|||
|
|
@ -195,8 +195,8 @@ class SyslogLogger extends AbstractLogger
|
|||
$logMessage .= $this->channel . ' ';
|
||||
$logMessage .= '[' . $this->logToString[$level] . ']: ';
|
||||
$logMessage .= $this->psrInterpolate($message, $context) . ' ';
|
||||
$logMessage .= @json_encode($context) . ' - ';
|
||||
$logMessage .= @json_encode($record);
|
||||
$logMessage .= $this->jsonEncodeArray($context) . ' - ';
|
||||
$logMessage .= $this->jsonEncodeArray($record);
|
||||
|
||||
return $logMessage;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -512,7 +512,6 @@ class ParseUrl
|
|||
{
|
||||
if (!empty($siteinfo['images'])) {
|
||||
array_walk($siteinfo['images'], function (&$image) use ($page_url) {
|
||||
$image = [];
|
||||
// According to the specifications someone could place a picture url into the content field as well.
|
||||
// But this doesn't seem to happen in the wild, so we don't cover it here.
|
||||
if (!empty($image['url'])) {
|
||||
|
|
@ -525,7 +524,11 @@ class ParseUrl
|
|||
$image['contenttype'] = $photodata['mime'];
|
||||
unset($image['url']);
|
||||
ksort($image);
|
||||
} else {
|
||||
$image = [];
|
||||
}
|
||||
} else {
|
||||
$image = [];
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -711,7 +714,7 @@ class ParseUrl
|
|||
|
||||
array_walk_recursive($siteinfo, function (&$element) {
|
||||
if (is_string($element)) {
|
||||
$element = html_entity_decode($element, ENT_COMPAT, 'UTF-8');
|
||||
$element = trim(strip_tags(html_entity_decode($element, ENT_COMPAT, 'UTF-8')));
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue