Fix more errors

This commit is contained in:
Art4 2024-11-19 08:40:48 +00:00
parent caa826ca06
commit 2ff280d34c
3 changed files with 8 additions and 4 deletions

View file

@ -447,6 +447,7 @@ class App implements AppHelper
$requeststring = ($server['REQUEST_METHOD'] ?? '') . ' ' . ($server['REQUEST_URI'] ?? '') . ' ' . ($server['SERVER_PROTOCOL'] ?? '');
$this->logger->debug('Request received', ['address' => $server['REMOTE_ADDR'] ?? '', 'request' => $requeststring, 'referer' => $server['HTTP_REFERER'] ?? '', 'user-agent' => $server['HTTP_USER_AGENT'] ?? '']);
$request_start = microtime(true);
$request = $_REQUEST;
$this->profiler->set($start_time, 'start');
$this->profiler->set(microtime(true), 'classinit');
@ -581,7 +582,7 @@ class App implements AppHelper
// Processes data from GET requests
$httpinput = $httpInput->process();
$input = array_merge($httpinput['variables'], $httpinput['files'], $request ?? $_REQUEST);
$input = array_merge($httpinput['variables'], $httpinput['files'], $request);
// Let the module run its internal process (init, get, post, ...)
$timestamp = microtime(true);

View file

@ -269,7 +269,7 @@ abstract class BaseModule implements ICanHandleRequests
$request[$parameter] = $this->getRequestValue($input, $parameter, $defaultvalue);
}
foreach ($input ?? [] as $parameter => $value) {
foreach ($input as $parameter => $value) {
if ($parameter == 'pagename') {
continue;
}

View file

@ -12,7 +12,6 @@ use Friendica\Contact\Avatar;
use Friendica\Core\L10n;
use Friendica\Model\Contact;
use Friendica\Model\Photo;
use Friendica\Util\Images;
use Friendica\Object\Image;
use Friendica\Core\Config\Capability\IManageConfigValues;
use Friendica\Core\Protocol;
@ -115,6 +114,10 @@ HELP;
private function storeAvatar(string $resourceid, array $contact, bool $quit_on_invalid)
{
$photo = false;
$imgdata = false;
$image = null;
$valid = !empty($resourceid);
if ($valid) {
$this->out('1', false);
@ -143,7 +146,7 @@ HELP;
}
}
if ($valid) {
if ($valid && $image instanceof Image) {
$this->out('4', false);
$fields = Avatar::storeAvatarByImage($contact, $image);
} else {