]> git.mxchange.org Git - friendica.git/commitdiff
Changes:
authorRoland Häder <roland@mxchange.org>
Mon, 20 Jun 2022 16:55:17 +0000 (18:55 +0200)
committerRoland Häder <roland@mxchange.org>
Mon, 20 Jun 2022 16:56:22 +0000 (18:56 +0200)
- dumped default value for $input
- added unknown 'platform' which prevents an "Undefined index: platform in
  /var/www/.../src/Model/GServer.php on line 940" error

src/Model/GServer.php
tests/src/Util/StringsTest.php

index e5c1bb3b697b4c6cf1c0a0d5dbb702ce75af74f5..f6c5e14af2519ae9331413e3cfc12d92986edd2e 100644 (file)
@@ -918,8 +918,11 @@ class GServer
                        return [];
                }
 
-               $server = ['detection-method' => self::DETECT_NODEINFO_2,
-                       'register_policy' => Register::CLOSED];
+               $server = [
+                       'detection-method' => self::DETECT_NODEINFO_2,
+                       'register_policy' => Register::CLOSED,
+                       'platform' => 'unknown',
+               ];
 
                if (!empty($nodeinfo['openRegistrations'])) {
                        $server['register_policy'] = Register::OPEN;
index 67a8aa259c7969ab50c8cbc7d887d0ea747fe8a7..830f97b2f2e21d47da0aa9d51318ebee06b3f685 100644 (file)
@@ -119,12 +119,12 @@ class StringsTest extends TestCase
        /**
         * Tests if the string is a valid hexadecimal value
         *
-        * @param string $input
-        * @param bool   $valid
+        * @param string $input Input string
+        * @param bool   $valid Whether testing on valid or invalid
         *
         * @dataProvider dataIsHex
         */
-       public function testIsHex(string $input = '', bool $valid = false)
+       public function testIsHex(string $input, bool $valid = false)
        {
                self::assertEquals($valid, Strings::isHex($input));
        }