Merge remote-tracking branch 'upstream/develop' into loop-prevention

This commit is contained in:
Michael
2022-08-06 17:11:04 +00:00
4 changed files with 15 additions and 6 deletions
+1 -1
View File
@@ -87,7 +87,7 @@ HELP;
{
$first = $this->dba->selectFirst('contact', ['id', 'nurl', 'url'], ["`uri-id` = ? AND `nurl` != ? AND `url` != ?", $uriid, '', ''], ['order' => ['id']]);
if (empty($first)) {
$this->err($this->l10n->t('No valid first countact found for uri-id %d.', $uriid));
$this->err($this->l10n->t('No valid first contact found for uri-id %d.', $uriid));
return;
}
$this->out($first['url']);
+11 -2
View File
@@ -70,8 +70,17 @@ class HTTPException
$content = '';
if ($e->getCode() >= 400) {
$tpl = Renderer::getMarkupTemplate('http_status.tpl');
$content = Renderer::replaceMacros($tpl, self::getVars($e));
$vars = self::getVars($e);
try {
$tpl = Renderer::getMarkupTemplate('http_status.tpl');
$content = Renderer::replaceMacros($tpl, $vars);
} catch (\Exception $e) {
$content = "<h1>{$vars['$title']}</h1><p>{$vars['$message']}</p>";
if (DI::app()->isSiteAdmin()) {
$content .= "<p>{$vars['$thrown']}</p>";
$content .= "<pre>{$vars['$trace']}</pre>";
}
}
}
System::httpError($e->getCode(), $e->getDescription(), $content);
+1 -1
View File
@@ -226,7 +226,7 @@ class Processor
*/
public static function updateItem(array $activity)
{
$item = Post::selectFirst(['uri', 'uri-id', 'thr-parent', 'gravity', 'post-type'], ['uri' => $activity['id']]);
$item = Post::selectFirst(['uri', 'uri-id', 'thr-parent', 'gravity', 'post-type', 'private'], ['uri' => $activity['id']]);
if (!DBA::isResult($item)) {
Logger::warning('No existing item, item will be created', ['uri' => $activity['id']]);
$item = self::createItem($activity, false);