Test Failed
Push — master ( 239970...076b28 )
by Tomasz
10:54
created
core/diag/RFC5997Tests.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -88,24 +88,24 @@  discard block
 block discarded – undo
88 88
         $reqAuthenticator = random_bytes(16);
89 89
         $packetIdentifier = random_bytes(1);
90 90
         // construct Status-Server packet
91
-        $prePacket = RFC5997Tests::PACKET_TYPE_STATUS_SERVER .
92
-                $packetIdentifier .
93
-                RFC5997Tests::PACKET_LENGTH .
94
-                $reqAuthenticator .
95
-                RFC5997Tests::ATTRIBUTE_NAS_IDENTIFIER .
96
-                RFC5997Tests::LENGTH_NAS_IDENTIFIER .
91
+        $prePacket = RFC5997Tests::PACKET_TYPE_STATUS_SERVER.
92
+                $packetIdentifier.
93
+                RFC5997Tests::PACKET_LENGTH.
94
+                $reqAuthenticator.
95
+                RFC5997Tests::ATTRIBUTE_NAS_IDENTIFIER.
96
+                RFC5997Tests::LENGTH_NAS_IDENTIFIER.
97 97
                 RFC5997Tests::VALUE_NAS_IDENTIFIER;
98
-        $sigPacket = $prePacket .
99
-                RFC5997Tests::ATTRIBUTE_MESSAGE_AUTHENTICATOR .
100
-                RFC5997Tests::LENGTH_MESSAGE_AUTHENTICATOR .
98
+        $sigPacket = $prePacket.
99
+                RFC5997Tests::ATTRIBUTE_MESSAGE_AUTHENTICATOR.
100
+                RFC5997Tests::LENGTH_MESSAGE_AUTHENTICATOR.
101 101
                 "\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0";
102
-        $authPacket = $prePacket .
103
-                RFC5997Tests::ATTRIBUTE_MESSAGE_AUTHENTICATOR .
104
-                RFC5997Tests::LENGTH_MESSAGE_AUTHENTICATOR .
102
+        $authPacket = $prePacket.
103
+                RFC5997Tests::ATTRIBUTE_MESSAGE_AUTHENTICATOR.
104
+                RFC5997Tests::LENGTH_MESSAGE_AUTHENTICATOR.
105 105
                 hash_hmac("md5", $sigPacket, $this->secret, TRUE);
106 106
         $connectErrorNumber = 0;
107 107
         $connectErrorString = "";
108
-        $netHandle = fsockopen("udp://" . $this->ipAddr, $this->port, $connectErrorNumber, $connectErrorString, RFC5997Tests::CONNECTION_TIMEOUT);
108
+        $netHandle = fsockopen("udp://".$this->ipAddr, $this->port, $connectErrorNumber, $connectErrorString, RFC5997Tests::CONNECTION_TIMEOUT);
109 109
         if ($netHandle === FALSE) {
110 110
             throw new Exception("Unable to establish UDP socket resource. Error number was $connectErrorNumber, '$connectErrorString'");
111 111
         }
@@ -123,11 +123,11 @@  discard block
 block discarded – undo
123 123
             return AbstractTest::RETVAL_INVALID;
124 124
         }
125 125
         // check the response authenticator to prevent spoofing.
126
-        $sigResponse = RFC5997Tests::PACKET_TYPE_ACCESS_ACCEPT .
127
-                $packetIdentifier .
128
-                $read[2] . $read[3] .
129
-                $reqAuthenticator .
130
-                substr($read, 20) .
126
+        $sigResponse = RFC5997Tests::PACKET_TYPE_ACCESS_ACCEPT.
127
+                $packetIdentifier.
128
+                $read[2].$read[3].
129
+                $reqAuthenticator.
130
+                substr($read, 20).
131 131
                 $this->secret;
132 132
         $expected = hash("md5", $sigResponse, TRUE);
133 133
         if ($expected != substr($read, 4, 16)) {
Please login to merge, or discard this patch.
web/diag/processSociopath.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  *          <base_url>/copyright.php after deploying the software
20 20
  */
21 21
 
22
-require_once dirname(dirname(__DIR__)) . "/config/_config.php";
22
+require_once dirname(dirname(__DIR__))."/config/_config.php";
23 23
 \core\CAT::sessionStart();
24 24
 $loggerInstance = new \core\common\Logging();
25 25
 $loggerInstance->debug(4, "Sociopath test\n");
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         return NULL;
34 34
     }
35 35
     $loggerInstance->debug(4, $_SESSION['EVIDENCE']['QUESTIONSASKED']);
36
-    $loggerInstance->debug(4, "\nAnswer question " . $QNUM . "\n");
36
+    $loggerInstance->debug(4, "\nAnswer question ".$QNUM."\n");
37 37
     switch ($answer) {
38 38
         case 1:
39 39
             $loggerInstance->debug(4, "Revaluate with FALSE");
Please login to merge, or discard this patch.
web/user/remindIdP.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
  *          <base_url>/copyright.php after deploying the software
20 20
  */
21 21
 
22
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
22
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
23 23
 
24 24
 \core\CAT::sessionStart();
25 25
 
Please login to merge, or discard this patch.
web/lib/admin/Authentication.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@
 block discarded – undo
121 121
         if ($trailerPosition !== FALSE) {
122 122
             $base = substr($scriptself, 0, $trailerPosition);
123 123
             if ($base !== FALSE) {
124
-                $url = "//$servername" . $base . "/logout_check.php";
124
+                $url = "//$servername".$base."/logout_check.php";
125 125
             }
126 126
         }
127 127
 
Please login to merge, or discard this patch.
config/autoloader.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  *          <base_url>/copyright.php after deploying the software
20 20
  */
21 21
 
22
-require_once __DIR__ . "/../core/Psr4Autoloader.php";
22
+require_once __DIR__."/../core/Psr4Autoloader.php";
23 23
 use core\autoloader\Psr4Autoloader;
24 24
 
25 25
 // instantiate the loader
@@ -30,10 +30,10 @@  discard block
 block discarded – undo
30 30
 
31 31
 // register the base directories for the namespace prefix
32 32
 // include configuration
33
-$loader->addNamespace('config', __DIR__ );
33
+$loader->addNamespace('config', __DIR__);
34 34
 // include CAT/core library
35
-$loader->addNamespace('core', __DIR__ . "/../core");
35
+$loader->addNamespace('core', __DIR__."/../core");
36 36
 // include CAT/devices library
37
-$loader->addNamespace('devices', __DIR__ . "/../devices");
37
+$loader->addNamespace('devices', __DIR__."/../devices");
38 38
 // include CAT/web library
39
-$loader->addNamespace('web', __DIR__ . "/../web");
40 39
\ No newline at end of file
40
+$loader->addNamespace('web', __DIR__."/../web");
41 41
\ No newline at end of file
Please login to merge, or discard this patch.
utils/ocspweb/index.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 exec("openssl ocsp -reqin $derFilePath -req_text", $output, $retval);
98 98
 
99 99
 if ($retval !== 0) {
100
-    throw new Exception("openssl ocsp returned a non-zero return code. The DER data is probably bogus. B64 representation of DER data is: " . base64_encode($ocspRequestDer));
100
+    throw new Exception("openssl ocsp returned a non-zero return code. The DER data is probably bogus. B64 representation of DER data is: ".base64_encode($ocspRequestDer));
101 101
 }
102 102
 if ($output === NULL) { // this can't really happen, but makes Scrutinizer happier
103 103
     $output = [];
@@ -127,14 +127,14 @@  discard block
 block discarded – undo
127 127
  * back (if we have it).
128 128
  */
129 129
 if (strcasecmp($nameHash, OUR_NAME_HASH) != 0 || strcasecmp($keyHash, OUR_KEY_HASH) != 0) {
130
-    throw new Exception("The request is about a different Issuer name / public key. Expected vs. actual name hash: " . OUR_NAME_HASH . " / $nameHash, " . OUR_KEY_HASH . " / $keyHash");
130
+    throw new Exception("The request is about a different Issuer name / public key. Expected vs. actual name hash: ".OUR_NAME_HASH." / $nameHash, ".OUR_KEY_HASH." / $keyHash");
131 131
 }
132
-error_log("base64-encoded request: " . base64_encode($ocspRequestDer));
132
+error_log("base64-encoded request: ".base64_encode($ocspRequestDer));
133 133
 
134
-$response = fopen(__DIR__ . "/statements/" . $serialHex . ".der", "r");
134
+$response = fopen(__DIR__."/statements/".$serialHex.".der", "r");
135 135
 if ($response === FALSE) { // not found
136 136
     // first lets load the unauthorised response, which is the default reply
137
-    $unauthResponse = fopen(__DIR__ . "/statements/UNAUTHORIZED.der", "r");
137
+    $unauthResponse = fopen(__DIR__."/statements/UNAUTHORIZED.der", "r");
138 138
     if ($unauthResponse === FALSE) {
139 139
         throw new Exception("Unable to open our canned UNAUTHORIZED response!");
140 140
     }
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 
177 177
 $responseContent = fread($response, 1000000);
178 178
 fclose($response);
179
-error_log("base64-encoded response: " . base64_encode($responseContent));
179
+error_log("base64-encoded response: ".base64_encode($responseContent));
180 180
 header('Content-Type: application/ocsp-response');
181
-header('Content-Length: ' . strlen($responseContent));
181
+header('Content-Length: '.strlen($responseContent));
182 182
 echo $responseContent;
Please login to merge, or discard this patch.
core/SilverbulletInvitation.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
         $this->activationsTotal = $invitationRow->quantity;
146 146
         $certificatesResult = $this->databaseHandle->exec("SELECT `serial_number`, `ca_type` FROM `silverbullet_certificate` WHERE `silverbullet_invitation_id` = ? ORDER BY `revocation_status`, `expiry` DESC", "i", $this->identifier);
147 147
         $certificatesNumber = ($certificatesResult ? $certificatesResult->num_rows : 0);
148
-        $this->loggerInstance->debug(5, "At token validation level, " . $certificatesNumber . " certificates exist.\n");
148
+        $this->loggerInstance->debug(5, "At token validation level, ".$certificatesNumber." certificates exist.\n");
149 149
         // SELECT -> resource, no boolean
150 150
         while ($runner = mysqli_fetch_object(/** @scrutinizer ignore-type */ $certificatesResult)) {
151 151
             $this->associatedCertificates[] = new \core\SilverbulletCertificate($runner->serial_number, $runner->ca_type);
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
                 throw new Exception("Uh. Something went seriously wrong with URL path mangling.");
205 205
             }
206 206
         }
207
-        $link = $link . $relPath;
207
+        $link = $link.$relPath;
208 208
 
209 209
         if (preg_match('/admin$/', $link)) {
210 210
             $link = substr($link, 0, -6);
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
             }
214 214
         }
215 215
 
216
-        return $link . '/accountstatus/accountstatus.php?token=' . $this->invitationTokenString;
216
+        return $link.'/accountstatus/accountstatus.php?token='.$this->invitationTokenString;
217 217
     }
218 218
 
219 219
     /**
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
         $text .= sprintf(_("A new %s access credential has been created for you by your network administrator."), \config\ConfAssistant::CONSORTIUM['display_name']);
241 241
         $text .= " ";
242 242
         $text .= sprintf(_("Please follow the following link with the device you want to enable for %s to get a custom %s installation program just for you. You can click on the link, copy and paste it into a browser or scan the attached QR code."), \config\ConfAssistant::CONSORTIUM['display_name'], \config\ConfAssistant::CONSORTIUM['display_name']);
243
-        $text .= "\n\n" . $this->link() . "\n\n"; // gets replaced with the token value by getBody()
243
+        $text .= "\n\n".$this->link()."\n\n"; // gets replaced with the token value by getBody()
244 244
         $text .= sprintf(_("Please keep this email or bookmark this link for future use. After picking up your %s installation program, you can use the same link to get status information about your %s account."), \config\ConfAssistant::CONSORTIUM['display_name'], \config\ConfAssistant::CONSORTIUM['display_name']);
245 245
         $text .= "\n\n";
246 246
         $text .= _("Regards,");
Please login to merge, or discard this patch.
web/diag/diag.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,8 +42,8 @@
 block discarded – undo
42 42
     $auth->authenticate();
43 43
 }
44 44
 if (isset($_SESSION['admin_diag_auth'])) {
45
-   $admin =  1;
46
-   unset($_SESSION['admin_diag_auth']);
45
+    $admin =  1;
46
+    unset($_SESSION['admin_diag_auth']);
47 47
 }
48 48
 $Gui = new \web\lib\user\Gui();
49 49
 $skinObject = new \web\lib\user\Skinjob($_REQUEST['skin'] ?? $_SESSION['skin'] ?? $fedskin[0] ?? \config\Master::APPEARANCE['skins'][0]);
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  *          <base_url>/copyright.php after deploying the software
20 20
  */
21 21
 
22
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
22
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
23 23
 $admin = filter_input(INPUT_GET, 'admin', FILTER_VALIDATE_INT);
24 24
 $sp = filter_input(INPUT_GET, 'sp', FILTER_VALIDATE_INT);
25 25
 $givenRealm = htmlspecialchars(strip_tags(filter_input(INPUT_GET, 'realm')));
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
             unset($q_el[$idx]);
36 36
             $q_r = preg_replace("/\?.*/", "", $_SERVER['REQUEST_URI']);
37 37
             if (count($q_el)) {
38
-                $q_r = $q_r . '?' . implode('&', $q_el);
38
+                $q_r = $q_r.'?'.implode('&', $q_el);
39 39
             }
40 40
             $_SERVER['REQUEST_URI'] = $q_r;
41 41
         }
@@ -44,11 +44,11 @@  discard block
 block discarded – undo
44 44
     $auth->authenticate();
45 45
 }
46 46
 if (isset($_SESSION['admin_diag_auth'])) {
47
-   $admin =  1;
47
+   $admin = 1;
48 48
    unset($_SESSION['admin_diag_auth']);
49 49
 }
50 50
 $Gui = new \web\lib\user\Gui();
51 51
 $skinObject = new \web\lib\user\Skinjob($_REQUEST['skin'] ?? $_SESSION['skin'] ?? $fedskin[0] ?? \config\Master::APPEARANCE['skins'][0]);
52
-require "../skins/" . $skinObject->skin . "/diag/diag.php";
52
+require "../skins/".$skinObject->skin."/diag/diag.php";
53 53
 
54 54
 
Please login to merge, or discard this patch.
web/admin/logout_check.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
  *          <base_url>/copyright.php after deploying the software
20 20
  */
21 21
 
22
-require_once dirname(dirname(dirname(__FILE__))) . "/config/_config.php";
22
+require_once dirname(dirname(dirname(__FILE__)))."/config/_config.php";
23 23
 require_once \config\Master::AUTHENTICATION['ssp-path-to-autoloader'];
24 24
 
25 25
 $deco = new \web\lib\admin\PageDecoration();
@@ -38,13 +38,13 @@  discard block
 block discarded – undo
38 38
     if ($cutoff !== FALSE) {    
39 39
         $substring = substr($_SERVER['PHP_SELF'], 0, $cutoff);
40 40
         if ($substring !== FALSE) {
41
-            $url = "//" . htmlspecialchars($_SERVER['SERVER_NAME']) . $substring;
41
+            $url = "//".htmlspecialchars($_SERVER['SERVER_NAME']).$substring;
42 42
         }
43 43
     }
44 44
     header("Location: $url");
45 45
 } else {
46 46
     /* Logout failed. Tell the user to close the browser. */
47 47
     echo $deco->pageheader(_("Incomplete Logout"), "ADMIN", FALSE);
48
-    echo "<p>" . _("We were unable to log you out of all your sessions. To be completely sure that you are logged out, you need to close your web browser.") . "</p>";
48
+    echo "<p>"._("We were unable to log you out of all your sessions. To be completely sure that you are logged out, you need to close your web browser.")."</p>";
49 49
     echo $deco->footer();
50 50
 }
Please login to merge, or discard this patch.