]> git.mxchange.org Git - friendica.git/commitdiff
Fixed some stuff from PR #13208 feedback:
authorRoland Häder <roland@mxchange.org>
Fri, 9 Jun 2023 20:19:48 +0000 (22:19 +0200)
committerRoland Häder <roland@mxchange.org>
Fri, 9 Jun 2023 20:21:59 +0000 (22:21 +0200)
- HTTPException is already imported
- same-value-assignment not needed

src/Network/Probe.php
src/Protocol/Diaspora.php

index bd98f39103bc2b8da1ce388a1939e4fec961e731..2b5cc3cff7d02a7cdcaa0209d14813ca37524cde 100644 (file)
@@ -341,12 +341,10 @@ class Probe
         * @param string  $uri     Address that should be probed
         * @param string  $network Test for this specific network
         * @param integer $uid     User ID for the probe (only used for mails)
-        * @param boolean $cache   Use cached values?
         *
         * @return array uri data
         * @throws HTTPException\InternalServerErrorException
         * @throws \ImagickException
-        * @todo Choice: implement $cache parameter or remove documentation
         */
        public static function uri(string $uri, string $network = '', int $uid = -1): array
        {
index 4549ba643f88023ebcbf17aebf6d97a8b01868f9..abe56cb9a1e6f600feee1d2d5c092188cac7ac70 100644 (file)
@@ -42,7 +42,6 @@ use Friendica\Model\Tag;
 use Friendica\Model\User;
 use Friendica\Network\HTTPClient\Client\HttpClientAccept;
 use Friendica\Network\HTTPException;
-use Friendica\Network\HTTPException\BadRequestException;
 use Friendica\Network\Probe;
 use Friendica\Protocol\Delivery;
 use Friendica\Util\Crypto;
@@ -268,7 +267,7 @@ class Diaspora
                                if ($no_exit) {
                                        return false;
                                } else {
-                                       throw new BadRequestException();
+                                       throw new HTTPException\BadRequestException();
                                }
                        }
                } else {
@@ -282,7 +281,7 @@ class Diaspora
                        if ($no_exit) {
                                return false;
                        } else {
-                               throw new BadRequestException();
+                               throw new HTTPException\BadRequestException();
                        }
                }
 
@@ -308,7 +307,7 @@ class Diaspora
                        if ($no_exit) {
                                return false;
                        } else {
-                               throw new BadRequestException();
+                               throw new HTTPException\BadRequestException();
                        }
                }
 
@@ -323,7 +322,7 @@ class Diaspora
                        if ($no_exit) {
                                return false;
                        } else {
-                               throw new BadRequestException();
+                               throw new HTTPException\BadRequestException();
                        }
                }
 
@@ -333,7 +332,7 @@ class Diaspora
                        if ($no_exit) {
                                return false;
                        } else {
-                               throw new BadRequestException();
+                               throw new HTTPException\BadRequestException();
                        }
                }
 
@@ -425,7 +424,7 @@ class Diaspora
 
                if (!$base) {
                        Logger::notice('unable to locate salmon data in xml');
-                       throw new BadRequestException();
+                       throw new HTTPException\BadRequestException();
                }
 
 
@@ -465,14 +464,14 @@ class Diaspora
                $key = self::key($author);
                if (!$key) {
                        Logger::notice('Could not retrieve author key.');
-                       throw new BadRequestException();
+                       throw new HTTPException\BadRequestException();
                }
 
                $verify = Crypto::rsaVerify($signed_data, $signature, $key);
 
                if (!$verify) {
                        Logger::notice('Message did not verify. Discarding.');
-                       throw new BadRequestException();
+                       throw new HTTPException\BadRequestException();
                }
 
                Logger::info('Message verified.');
@@ -2686,7 +2685,6 @@ class Diaspora
                        $datarray['object-type'] = Activity\ObjectType::IMAGE;
                        $datarray['post-type'] = Item::PT_IMAGE;
                } elseif ($data->poll) {
-                       $datarray['object-type'] = Activity\ObjectType::NOTE;
                        $datarray['post-type'] = Item::PT_POLL;
                }