]> git.mxchange.org Git - friendica.git/commitdiff
Fix more errors
authorArt4 <art4@wlabs.de>
Sun, 17 Nov 2024 22:26:43 +0000 (22:26 +0000)
committerArt4 <art4@wlabs.de>
Sun, 17 Nov 2024 22:26:43 +0000 (22:26 +0000)
src/Module/Security/TwoFactor/Trust.php
src/Module/Settings/Profile/Photo/Crop.php
src/Module/Xrd.php
src/Navigation/Notifications/ValueObject/FormattedNotify.php
view/theme/frio/config.php

index ce6b370befa8fc9ad72a4253883f6aafe9550465..a2a40ea5e61594af5e0ae14f5b17942b2a12fd95 100644 (file)
@@ -94,7 +94,7 @@ class Trust extends BaseModule
                                // exception wanted!
                                throw $e;
                        } catch (\Exception $e) {
-                               $this->logger->warning('Unexpected error during authentication.', ['user' => $this->session->getLocalUserId(), 'exception' => $exception]);
+                               $this->logger->warning('Unexpected error during authentication.', ['user' => $this->session->getLocalUserId(), 'exception' => $e]);
                        }
                }
        }
index 0853b2ae6d5f0b683ec52306969dc9072f4fcbb2..d18b3e862d6e220653b63e78253f9cc64948aff1 100644 (file)
@@ -46,9 +46,6 @@ class Crop extends BaseSettings
                $base_image = Photo::selectFirst([], ['resource-id' => $resource_id, 'uid' => DI::userSession()->getLocalUserId(), 'scale' => $scale]);
                if (DBA::isResult($base_image)) {
                        $Image = Photo::getImageForPhoto($base_image);
-                       if (empty($Image)) {
-                               throw new HTTPException\InternalServerErrorException();
-                       }
 
                        if ($Image->isValid()) {
                                // If setting for the default profile, unset the profile photo flag from any other photos I own
@@ -185,9 +182,6 @@ class Crop extends BaseSettings
                }
 
                $Image = Photo::getImageForPhoto($photos[0]);
-               if (empty($Image)) {
-                       throw new HTTPException\InternalServerErrorException();
-               }
 
                $imagecrop = [
                        'resource-id' => $resource_id,
index 3e55f0571b8f5030e376100f64641f4d2fd307df..39b4e2538c6277edb3000f3df3b10a1846cbb86c 100644 (file)
@@ -64,6 +64,8 @@ class Xrd extends BaseModule
 
                header('Vary: Accept', false);
 
+               $alias = '';
+
                if ($name == User::getActorName()) {
                        $owner = User::getSystemAccount();
                        if (empty($owner)) {
@@ -108,7 +110,7 @@ class Xrd extends BaseModule
                        $parts[] = current(explode(';', $part));
                }
 
-               if (empty($parts)) {
+               if ($parts === []) {
                        return $default;
                } elseif (in_array('application/jrd+json', $parts) && !in_array('application/xrd+xml', $parts)) {
                        return Response::TYPE_JSON;
index e8abfe283a952982137d3b7fde39fa727b761135..d92d39e426b943f1c6722ef41a72b3cfab52bf63 100644 (file)
@@ -41,13 +41,13 @@ class FormattedNotify extends BaseDataTransferObject
 
        public function __construct(string $label, string $link, string $image, string $url, string $text, string $when, string $ago, bool $seen)
        {
-               $this->label = $label ?? '';
-               $this->link  = $link  ?? '';
-               $this->image = $image ?? '';
-               $this->url   = $url   ?? '';
-               $this->text  = $text  ?? '';
-               $this->when  = $when  ?? '';
-               $this->ago   = $ago   ?? '';
-               $this->seen  = $seen  ?? false;
+               $this->label = $label;
+               $this->link  = $link;
+               $this->image = $image;
+               $this->url   = $url;
+               $this->text  = $text;
+               $this->when  = $when;
+               $this->ago   = $ago;
+               $this->seen  = $seen;
        }
 }
index b16289a032ea8aa98d66f2934a77bee1db93c670..d157b58a2d4a947598e62c7f14dd300d205831a0 100644 (file)
@@ -92,7 +92,7 @@ function theme_admin_post()
        }
 }
 
-function theme_content(): string
+function theme_content(App $a): string
 {
        if (!DI::userSession()->getLocalUserId()) {
                return '';