Passed
Push — release_2_1 ( 8ffb06...6b1ac5 )
by Maja
10:32
created
web/diag/radius_tests.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -374,7 +374,7 @@
 block discarded – undo
374 374
         throw new Exception("Unknown test requested: default case reached!");
375 375
 }
376 376
 $returnarray['datetime'] = date("Y-m-d H:i:s");
377
-if ($token!= '' && is_dir($jsonDir.'/'.$token)) {
377
+if ($token != '' && is_dir($jsonDir.'/'.$token)) {
378 378
     @mkdir($jsonDir.'/'.$token, 0777, true);
379 379
 }
380 380
 $json_data = json_encode($returnarray);
Please login to merge, or discard this patch.
web/diag/action_realmcheck.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -578,9 +578,9 @@  discard block
 block discarded – undo
578 578
                     $naptr = $rfc7585suite->relevantNAPTR();
579 579
                     if ($naptr == \core\diag\RADIUSTests::RETVAL_NOTCONFIGURED) {
580 580
                         if ($dynType == "") {
581
-                        	echo "<tr><td>" . _("Dynamic discovery test is not configured") . "</td><td>";
581
+                            echo "<tr><td>" . _("Dynamic discovery test is not configured") . "</td><td>";
582 582
                         } else {
583
-                        	echo "<tr><td>" . _("OpenRoaming connectivity test is not configured") . "</td><td>";
583
+                            echo "<tr><td>" . _("OpenRoaming connectivity test is not configured") . "</td><td>";
584 584
                         }
585 585
                     } else {
586 586
                         echo "<table>";
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
                         echo "}
699 699
               </script>";
700 700
                         } else {
701
-                   echo ' 
701
+                    echo ' 
702 702
               function run_openroaming() {
703 703
                  running_ajax_openroaming = 0;
704 704
                  $("#main_openroaming_ico").attr("src",icon_loading);
@@ -720,10 +720,10 @@  discard block
 block discarded – undo
720 720
                         } 
721 721
                     }
722 722
                     if ($dynType == '') {
723
-                         $naptrs[0] = $naptr;
724
-                     } else {
725
-                         $naptrs[1] = $naptr;
726
-                     }
723
+                            $naptrs[0] = $naptr;
724
+                        } else {
725
+                            $naptrs[1] = $naptr;
726
+                        }
727 727
                 }
728 728
                     echo "<strong>" . _("Static connectivity tests") . "</strong>
729 729
          <table><tr>
@@ -736,7 +736,7 @@  discard block
 block discarded – undo
736 736
          </tr></table>";
737 737
                     }
738 738
                     if (isset($orrealm) && count($orrealm) && ($naptrs[1] > 0)) {
739
-                      echo "<hr><strong>" . _("OpenRoaming connectivity tests") . "</strong>
739
+                        echo "<hr><strong>" . _("OpenRoaming connectivity tests") . "</strong>
740 740
          <table><tr>
741 741
          <td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='main_openroaming_ico' class='icon'></td><td id='main_openroaming_result' style='display:none'>&nbsp;</td>
742 742
          </tr></table>";
@@ -774,12 +774,12 @@  discard block
 block discarded – undo
774 774
             <?php
775 775
             for ($i=3; $i<5; $i++) {
776 776
                 if ($i == 3 && $naptrs[0] <= 0) {
777
-                   continue;
777
+                    continue;
778 778
                 }
779 779
                 if ($i == 4) {
780
-                   if ((count($orrealm) == 0) || ($naptrs[1] <= 0)) {
781
-                       continue;
782
-                   }
780
+                    if ((count($orrealm) == 0) || ($naptrs[1] <= 0)) {
781
+                        continue;
782
+                    }
783 783
                 }
784 784
                 if ($i == 3) {
785 785
                     $rfc7585suite = $dnsChecks;
@@ -796,16 +796,16 @@  discard block
 block discarded – undo
796 796
                     echo "_tests'><fieldset class='option_container'>
797 797
                 <legend><strong>";
798 798
                     if ($i==3) {
799
-                     echo _("DYNAMIC connectivity tests");
799
+                        echo _("DYNAMIC connectivity tests");
800 800
                     } else {
801
-                     echo _("OpenRoaming connectivity tests");
801
+                        echo _("OpenRoaming connectivity tests");
802 802
                     }
803 803
                     echo  "</strong></legend>";
804 804
                     $prefix1 = 'dynamic';
805 805
                     $prefix2 = '';
806 806
                     if ($i == 4) {
807
-                    	$prefix1 = 'openroaming';
808
-                    	$prefix2 = $prefix1;
807
+                        $prefix1 = 'openroaming';
808
+                        $prefix2 = $prefix1;
809 809
                     }
810 810
                     $resultstoprint = [];
811 811
                     if (count($rfc7585suite->NAPTR_hostname_records) > 0) {
Please login to merge, or discard this patch.
Spacing   +77 added lines, -77 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
 
24 24
 $loggerInstance = new \core\common\Logging();
25 25
 
@@ -69,13 +69,13 @@  discard block
 block discarded – undo
69 69
             $dnsChecksOR = new \core\diag\RFC7585Tests($check_realm, "aaa+auth:radius.tls.tcp");
70 70
         }
71 71
     } else {
72
-        $error_message = _("You asked for a realm check, but we don't know the realm for this profile!") . "</p>";
72
+        $error_message = _("You asked for a realm check, but we don't know the realm for this profile!")."</p>";
73 73
     }
74 74
 } else { // someone else's realm, and we don't know anything about it... only shallow checks
75 75
     $check_realm = $validator->realm($realm ?? $_SESSION['check_realm'] ?? "");
76 76
     if ($check_realm !== FALSE) {
77 77
         $_SESSION['check_realm'] = $check_realm;
78
-        $testsuite = new \core\diag\RADIUSTests($check_realm, "@" . $check_realm);
78
+        $testsuite = new \core\diag\RADIUSTests($check_realm, "@".$check_realm);
79 79
         $dnsChecks = new \core\diag\RFC7585Tests($check_realm);
80 80
     } else {
81 81
         $error_message = _("No valid realm name given, cannot execute any checks!");
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
     var listofcas = "<?php echo _("You should update your list of accredited CAs") ?>";
127 127
     var getitfrom = "<?php echo _("Get it from here.") ?>";
128 128
     var listsource = "<?php echo \config\Diagnostics::RADIUSTESTS['accreditedCAsURL'] ?>";
129
-    var moretext = "<?php echo _("more") . "&raquo;" ?>";
129
+    var moretext = "<?php echo _("more")."&raquo;" ?>";
130 130
     var lesstext = "<?php echo "&laquo" ?>";
131 131
     var morealltext = "<?php echo _("Show detailed information for all tests") ?>";
132 132
     var unknownca_code = "<?php echo \core\diag\RADIUSTests::CERTPROB_UNKNOWN_CA ?>";
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
                         }
272 272
                     }
273 273
                     cliinfo = cliinfo + '<li><table><tbody><tr><td class="icon_td"><img class="icon" src="' + icons[level] + '" style="width: 24px;"></td><td>' + state;
274
-                    cliinfo = cliinfo + ' <?php echo "(" . sprintf(_("elapsed time: %sms."), "'+data.ca[key].certificate[c].time_millisec+'&nbsp;") . ")"; ?>' + add + '</td></tr>';
274
+                    cliinfo = cliinfo + ' <?php echo "(".sprintf(_("elapsed time: %sms."), "'+data.ca[key].certificate[c].time_millisec+'&nbsp;").")"; ?>' + add + '</td></tr>';
275 275
                     cliinfo = cliinfo + '</tbody></table></ul></li>';
276 276
                     if (data.ca[key].certificate[c].finalerror === 1) {
277 277
                         cliinfo = cliinfo + '<li>' + restskipped + '</li>';
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
                 });
469 469
             }
470 470
             o = o + cert_data + '</table>';
471
-            $("#eap_test" + data.hostindex).append('<strong><img style="position: relative; top: 2px;" src="' + icons[v.level] + '"><span style="position: relative; top: -5px; <?php echo $start;?>: 1em">' + v.eap + ' &ndash; <?php printf(_("elapsed time: %sms."), "'+v.time_millisec+'&nbsp;") ?></span></strong><div class="more" style="padding-<?php echo $start;?>: 40px"><div class="morecontent"><div style="display:none; background: #eee;">' + o + '</div><a href="" class="morelink">' + moretext + '</a></div></div>');
471
+            $("#eap_test" + data.hostindex).append('<strong><img style="position: relative; top: 2px;" src="' + icons[v.level] + '"><span style="position: relative; top: -5px; <?php echo $start; ?>: 1em">' + v.eap + ' &ndash; <?php printf(_("elapsed time: %sms."), "'+v.time_millisec+'&nbsp;") ?></span></strong><div class="more" style="padding-<?php echo $start; ?>: 40px"><div class="morecontent"><div style="display:none; background: #eee;">' + o + '</div><a href="" class="morelink">' + moretext + '</a></div></div>');
472 472
         });
473 473
     }
474 474
 
@@ -479,8 +479,8 @@  discard block
 block discarded – undo
479 479
 <?php
480 480
 foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) {
481 481
     print "
482
-$(\"#live_src" . $hostindex . "_img\").attr('src',icon_loading);
483
-$(\"#live_src" . $hostindex . "_img\").show();
482
+$(\"#live_src" . $hostindex."_img\").attr('src',icon_loading);
483
+$(\"#live_src" . $hostindex."_img\").show();
484 484
 $.ajax({
485 485
     url: 'radius_tests.php?src=0&hostindex=$hostindex&realm='+realm,
486 486
     type: 'POST',
@@ -510,15 +510,15 @@  discard block
 block discarded – undo
510 510
 <?php
511 511
 foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) {
512 512
     if ($testedProfile !== NULL) {
513
-        $extraarg = "profile_id: " . $testedProfile->identifier . ", ";
513
+        $extraarg = "profile_id: ".$testedProfile->identifier.", ";
514 514
     } else {
515 515
         $extraarg = "";
516 516
     }
517 517
     print "
518
-$(\"#src" . $hostindex . "_img\").attr('src',icon_loading);
518
+$(\"#src" . $hostindex."_img\").attr('src',icon_loading);
519 519
 $(\"#src$hostindex\").html('');
520 520
 running_ajax_stat++;
521
-$.get('radius_tests.php', {test_type: 'udp', $extraarg realm: realm, src: $hostindex, lang: '" . $gui->languageInstance->getLang() . "', hostindex: '$hostindex'  }, udp, 'json');
521
+$.get('radius_tests.php', {test_type: 'udp', $extraarg realm: realm, src: $hostindex, lang: '".$gui->languageInstance->getLang()."', hostindex: '$hostindex'  }, udp, 'json');
522 522
 
523 523
 ";
524 524
 }
@@ -545,7 +545,7 @@  discard block
 block discarded – undo
545 545
     if ($check_realm === FALSE) {
546 546
         print "<p>$error_message</p>";
547 547
     } else {
548
-        print "<h1>" . sprintf(_("Realm testing for: %s"), $check_realm) . "</h1>\n";
548
+        print "<h1>".sprintf(_("Realm testing for: %s"), $check_realm)."</h1>\n";
549 549
         ?>
550 550
         <div id="debug_out" style="display: none"></div>
551 551
         <div id="tabs" style="min-width: 600px; max-width:1000px">
@@ -567,25 +567,25 @@  discard block
 block discarded – undo
567 567
                     // NAPTR existence check
568 568
                     if ($dynType == "") {
569 569
                         $rfc7585suite = $dnsChecks;
570
-                        echo "<strong>" . _("DNS checks") . "</strong><div>";
570
+                        echo "<strong>"._("DNS checks")."</strong><div>";
571 571
                     } else {
572 572
                         if (count($orrealm) == 0) {
573 573
                             continue;
574 574
                         }
575 575
                         $rfc7585suite = $dnsChecksOR;
576
-                        echo "<strong>" . _("OpenRoaming DNS checks") . "</strong><div>";
576
+                        echo "<strong>"._("OpenRoaming DNS checks")."</strong><div>";
577 577
                     }
578 578
                     $naptr = $rfc7585suite->relevantNAPTR();
579 579
                     if ($naptr == \core\diag\RADIUSTests::RETVAL_NOTCONFIGURED) {
580 580
                         if ($dynType == "") {
581
-                        	echo "<tr><td>" . _("Dynamic discovery test is not configured") . "</td><td>";
581
+                        	echo "<tr><td>"._("Dynamic discovery test is not configured")."</td><td>";
582 582
                         } else {
583
-                        	echo "<tr><td>" . _("OpenRoaming connectivity test is not configured") . "</td><td>";
583
+                        	echo "<tr><td>"._("OpenRoaming connectivity test is not configured")."</td><td>";
584 584
                         }
585 585
                     } else {
586 586
                         echo "<table>";
587 587
                         // output in friendly words
588
-                        echo "<tr><td>" . _("Checking NAPTR existence:") . "</td><td>";
588
+                        echo "<tr><td>"._("Checking NAPTR existence:")."</td><td>";
589 589
                         switch ($naptr) {
590 590
                             case \core\diag\RFC7585Tests::RETVAL_NONAPTR:
591 591
                                 echo _("This realm has no NAPTR records.");
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
 
601 601
                         // compliance checks for NAPTRs
602 602
                         if ($naptr > 0) {
603
-                            echo "<tr><td>" . _("Checking NAPTR compliance (flag = S and regex = {empty}):") . "</td><td>";
603
+                            echo "<tr><td>"._("Checking NAPTR compliance (flag = S and regex = {empty}):")."</td><td>";
604 604
                             $naptr_valid = $rfc7585suite->relevantNAPTRcompliance();
605 605
                             switch ($naptr_valid) {
606 606
                                 case \core\diag\RADIUSTests::RETVAL_OK:
@@ -615,7 +615,7 @@  discard block
 block discarded – undo
615 615
                         // SRV resolution
616 616
                         if ($naptr > 0 && $naptr_valid == \core\diag\RADIUSTests::RETVAL_OK) {
617 617
                             $srv = $rfc7585suite->relevantNAPTRsrvResolution();
618
-                            echo "<tr><td>" . _("Checking SRVs:") . "</td><td>";
618
+                            echo "<tr><td>"._("Checking SRVs:")."</td><td>";
619 619
                             switch ($srv) {
620 620
                                 case \core\diag\RADIUSTests::RETVAL_SKIPPED:
621 621
                                     echo _("This check was skipped.");
@@ -631,7 +631,7 @@  discard block
 block discarded – undo
631 631
                         // IP addresses for the hosts
632 632
                         if ($naptr > 0 && $naptr_valid == \core\diag\RADIUSTests::RETVAL_OK && $srv > 0) {
633 633
                             $hosts = $rfc7585suite->relevantNAPTRhostnameResolution();
634
-                            echo "<tr><td>" . _("Checking IP address resolution:") . "</td><td>";
634
+                            echo "<tr><td>"._("Checking IP address resolution:")."</td><td>";
635 635
                             switch ($srv) {
636 636
                                 case \core\diag\RADIUSTests::RETVAL_SKIPPED:
637 637
                                     echo _("This check was skipped.");
@@ -648,12 +648,12 @@  discard block
 block discarded – undo
648 648
                         echo "</table><br/>";
649 649
                         if ($dynType == "") {
650 650
                             if (count($testsuite->listerrors()) == 0) {
651
-                                echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC"))) . _("with no DNS errors encountered. Congratulations!");
651
+                                echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC")))._("with no DNS errors encountered. Congratulations!");
652 652
                             } else {
653
-                                echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC"))) . _("but there were DNS errors! Check them!") . " " . _("You should re-run the tests after fixing the errors; more errors might be uncovered at that point. The exact error causes are listed below.");
653
+                                echo sprintf(_("Realm is <strong>%s</strong> "), _(($naptr > 0 ? "DYNAMIC" : "STATIC")))._("but there were DNS errors! Check them!")." "._("You should re-run the tests after fixing the errors; more errors might be uncovered at that point. The exact error causes are listed below.");
654 654
                                 echo "<div class='notacceptable'><table>";
655 655
                                 foreach ($testsuite->listerrors() as $details) {
656
-                                    echo "<tr><td>" . $details['TYPE'] . "</td><td>" . $details['TARGET'] . "</td></tr>";
656
+                                    echo "<tr><td>".$details['TYPE']."</td><td>".$details['TARGET']."</td></tr>";
657 657
                                 }
658 658
                                 echo "</table></div>";
659 659
                             }
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
                  $("#dynamic_tests").show();
673 673
               ';             
674 674
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
675
-                            $host = ($addr['family'] == "IPv6" ? "[" : "") . $addr['IP'] . ($addr['family'] == "IPv6" ? "]" : "") . ":" . $addr['port'];
675
+                            $host = ($addr['family'] == "IPv6" ? "[" : "").$addr['IP'].($addr['family'] == "IPv6" ? "]" : "").":".$addr['port'];
676 676
                             $expectedName = $addr['hostname'];
677 677
                             $ssltest = 1;
678 678
                             if (isset($addr['unavailable']) && $addr['unavailable']) {
@@ -690,9 +690,9 @@  discard block
 block discarded – undo
690 690
                             $protstr = implode(';', $protocols);
691 691
                             print "
692 692
                             running_ajax_dyn++;
693
-                            $.ajax({url:'radius_tests.php', data:{test_type: 'capath', realm: realm, src: '$host', lang: '" . $gui->languageInstance->getLang() . "', hostindex: '$hostindex', expectedname: '$expectedName', ssltest: $ssltest, protocols: '$protstr'}, error: eee, success: capath, dataType: 'json'}); 
693
+                            $.ajax({url:'radius_tests.php', data:{test_type: 'capath', realm: realm, src: '$host', lang: '".$gui->languageInstance->getLang()."', hostindex: '$hostindex', expectedname: '$expectedName', ssltest: $ssltest, protocols: '$protstr'}, error: eee, success: capath, dataType: 'json'}); 
694 694
                             running_ajax_dyn++;
695
-                            $.ajax({url:'radius_tests.php', data:{test_type: 'clients', realm: realm, src: '$host', lang: '" . $gui->languageInstance->getLang() . "', hostindex: '$hostindex', ssltest: $ssltest, protocols: '$protstr' }, error: eee, success: clients, dataType: 'json'}); 
695
+                            $.ajax({url:'radius_tests.php', data:{test_type: 'clients', realm: realm, src: '$host', lang: '".$gui->languageInstance->getLang()."', hostindex: '$hostindex', ssltest: $ssltest, protocols: '$protstr' }, error: eee, success: clients, dataType: 'json'}); 
696 696
                        ";
697 697
                         }
698 698
                         echo "}
@@ -708,11 +708,11 @@  discard block
 block discarded – undo
708 708
                  $("#openroaming_tests").show();
709 709
               ';
710 710
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
711
-                            $host = ($addr['family'] == "IPv6" ? "[" : "") . $addr['IP'] . ($addr['family'] == "IPv6" ? "]" : "") . ":" . $addr['port'];
711
+                            $host = ($addr['family'] == "IPv6" ? "[" : "").$addr['IP'].($addr['family'] == "IPv6" ? "]" : "").":".$addr['port'];
712 712
                             $expectedName = $addr['hostname'];
713 713
                             print "
714 714
                             running_ajax_openroaming++;
715
-                            $.ajax({url:'radius_tests.php', data:{test_type: 'openroamingcapath', realm: realm, src: '$host', lang: '" . $gui->languageInstance->getLang() . "', hostindex: '$hostindex', expectedname: '$expectedName' }, error: eee, success: capath, dataType: 'json'}); 
715
+                            $.ajax({url:'radius_tests.php', data:{test_type: 'openroamingcapath', realm: realm, src: '$host', lang: '".$gui->languageInstance->getLang()."', hostindex: '$hostindex', expectedname: '$expectedName' }, error: eee, success: capath, dataType: 'json'}); 
716 716
                        ";
717 717
                         }
718 718
                         echo "}
@@ -725,18 +725,18 @@  discard block
 block discarded – undo
725 725
                          $naptrs[1] = $naptr;
726 726
                      }
727 727
                 }
728
-                    echo "<strong>" . _("Static connectivity tests") . "</strong>
728
+                    echo "<strong>"._("Static connectivity tests")."</strong>
729 729
          <table><tr>
730 730
          <td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='main_static_ico' class='icon'></td><td id='main_static_result' style='display:none'>&nbsp;</td>
731 731
          </tr></table>";
732 732
                     if ($naptrs[0] > 0) {
733
-                        echo "<hr><strong>" . _("Dynamic connectivity tests") . "</strong>
733
+                        echo "<hr><strong>"._("Dynamic connectivity tests")."</strong>
734 734
          <table><tr>
735 735
          <td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='main_dynamic_ico' class='icon'></td><td id='main_dynamic_result' style='display:none'>&nbsp;</td>
736 736
          </tr></table>";
737 737
                     }
738 738
                     if (isset($orrealm) && count($orrealm) && ($naptrs[1] > 0)) {
739
-                      echo "<hr><strong>" . _("OpenRoaming connectivity tests") . "</strong>
739
+                      echo "<hr><strong>"._("OpenRoaming connectivity tests")."</strong>
740 740
          <table><tr>
741 741
          <td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='main_openroaming_ico' class='icon'></td><td id='main_openroaming_result' style='display:none'>&nbsp;</td>
742 742
          </tr></table>";
@@ -756,12 +756,12 @@  discard block
 block discarded – undo
756 756
                     print "<p>";
757 757
                     foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) {
758 758
                         print "<hr>";
759
-                        printf(_("Testing from: %s"), "<strong>" . \config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name'] . "</strong>");
759
+                        printf(_("Testing from: %s"), "<strong>".\config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name']."</strong>");
760 760
                         print "<table id='results$hostindex'  style='width:100%' class='udp_results'>
761 761
 <tr>
762
-<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='src" . $hostindex . "_img'></td>
762
+<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='src".$hostindex."_img'></td>
763 763
 <td id='src$hostindex' colspan=2>
764
-" . _("testing...") . "
764
+"._("testing...")."
765 765
 </td>
766 766
 </tr>
767 767
 </table>";
@@ -772,7 +772,7 @@  discard block
 block discarded – undo
772 772
 
773 773
             </div>
774 774
             <?php
775
-            for ($i=3; $i<5; $i++) {
775
+            for ($i = 3; $i < 5; $i++) {
776 776
                 if ($i == 3 && $naptrs[0] <= 0) {
777 777
                    continue;
778 778
                 }
@@ -787,15 +787,15 @@  discard block
 block discarded – undo
787 787
                     $rfc7585suite = $dnsChecksOR;
788 788
                 }
789 789
             ?>
790
-                <div id="tabs-<?php echo $i;?>">
791
-                    <button id="run_<?php if ($i==3) echo 'd'; else echo 'o';?>_tests"; onclick="run_<?php if ($i==3) echo 'dynamic'; else echo 'openroaming';?>()"><?php if ($i==3) echo _("Repeat dynamic connectivity tests"); else echo _("Repeat OpenRoaming connectivity tests");?></button>
790
+                <div id="tabs-<?php echo $i; ?>">
791
+                    <button id="run_<?php if ($i == 3) echo 'd'; else echo 'o'; ?>_tests"; onclick="run_<?php if ($i == 3) echo 'dynamic'; else echo 'openroaming'; ?>()"><?php if ($i == 3) echo _("Repeat dynamic connectivity tests"); else echo _("Repeat OpenRoaming connectivity tests"); ?></button>
792 792
 
793 793
                 <?php
794 794
                     echo "<div id='";
795
-                    if ($i==3) { echo 'dynamic'; } else { echo 'openroaming'; }
795
+                    if ($i == 3) { echo 'dynamic'; } else { echo 'openroaming'; }
796 796
                     echo "_tests'><fieldset class='option_container'>
797 797
                 <legend><strong>";
798
-                    if ($i==3) {
798
+                    if ($i == 3) {
799 799
                      echo _("DYNAMIC connectivity tests");
800 800
                     } else {
801 801
                      echo _("OpenRoaming connectivity tests");
@@ -809,11 +809,11 @@  discard block
 block discarded – undo
809 809
                     }
810 810
                     $resultstoprint = [];
811 811
                     if (count($rfc7585suite->NAPTR_hostname_records) > 0) {
812
-                        $resultstoprint[] = '<div style="align:'.$end.'; display: none;" id="' . $prefix1 . '_result_fail">' . _("Some errors were found during the tests, see below") . '</div><div style="align:'.$end.'; display: none;" id="' . $prefix1 . '_result_pass">' . _("All tests passed, congratulations!") . '</div>';
813
-                        $resultstoprint[] = '<div style="align:'.$end.';"><a href="" class="moreall">' . _('Show detailed information for all tests') . '</a></div>' . '<p><strong>' . _("Checking server handshake...") . "</strong><p>";
812
+                        $resultstoprint[] = '<div style="align:'.$end.'; display: none;" id="'.$prefix1.'_result_fail">'._("Some errors were found during the tests, see below").'</div><div style="align:'.$end.'; display: none;" id="'.$prefix1.'_result_pass">'._("All tests passed, congratulations!").'</div>';
813
+                        $resultstoprint[] = '<div style="align:'.$end.';"><a href="" class="moreall">'._('Show detailed information for all tests').'</a></div>'.'<p><strong>'._("Checking server handshake...")."</strong><p>";
814 814
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
815
-                            $bracketaddr = ($addr["family"] == "IPv6" ? "[" . $addr["IP"] . "]" : $addr["IP"]);
816
-                            $resultstoprint[] = '<p><strong>' . $bracketaddr . ' TCP/' . $addr['port'] . '</strong> (' . $addr['hostname'] . ')';
815
+                            $bracketaddr = ($addr["family"] == "IPv6" ? "[".$addr["IP"]."]" : $addr["IP"]);
816
+                            $resultstoprint[] = '<p><strong>'.$bracketaddr.' TCP/'.$addr['port'].'</strong> ('.$addr['hostname'].')';
817 817
                             $prots = [];
818 818
                             if (isset($addr['protocols'])) {
819 819
                                 foreach ($addr['protocols'] as $protocol) {
@@ -823,18 +823,18 @@  discard block
 block discarded – undo
823 823
                                 }
824 824
                             }
825 825
                             if (!empty($prots)) {
826
-                                $resultstoprint[] = ' ' . _("supported TLS protocols: ");
826
+                                $resultstoprint[] = ' '._("supported TLS protocols: ");
827 827
                                 $resultstoprint[] = implode(', ', $prots);
828 828
                                 if (!isset($addr['istls13']) || !$addr['istls13']) {
829
-                                    $resultstoprint[] = ' ' . '<font color="red">' . _("not supported: ") . 'TLS1.3</font>';
829
+                                    $resultstoprint[] = ' '.'<font color="red">'._("not supported: ").'TLS1.3</font>';
830 830
                                 }
831 831
                             }
832 832
                             $resultstoprint[] = '<ul style="list-style-type: none;" class="caresult"><li>';
833
-                            $resultstoprint[] = "<table id='" . $prefix2 . "caresults$hostindex'  style='width:100%'>
833
+                            $resultstoprint[] = "<table id='".$prefix2."caresults$hostindex'  style='width:100%'>
834 834
 <tr>
835
-<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='" . $prefix2 . "srcca$hostindex" . "_img'></td>
836
-<td id='" . $prefix2 . "srcca$hostindex'>
837
-" . _("testing...") . "
835
+<td class='icon_td'><img src='../resources/images/icons/loading51.gif' id='".$prefix2."srcca$hostindex"."_img'></td>
836
+<td id='" . $prefix2."srcca$hostindex'>
837
+"._("testing...")."
838 838
 </td>
839 839
 </tr>
840 840
 </table>";
@@ -842,26 +842,26 @@  discard block
 block discarded – undo
842 842
                         }
843 843
                         $clientstest = [];
844 844
                         foreach ($rfc7585suite->NAPTR_hostname_records as $hostindex => $addr) {
845
-                            $clientstest[] = '<p><strong>' . $addr['IP'] . ' TCP/' . $addr['port'] . '</strong></p><ol>';
846
-                            $clientstest[] = "<span id='" . $prefix2 . "clientresults$hostindex'><table style='width:100%'>
845
+                            $clientstest[] = '<p><strong>'.$addr['IP'].' TCP/'.$addr['port'].'</strong></p><ol>';
846
+                            $clientstest[] = "<span id='".$prefix2."clientresults$hostindex'><table style='width:100%'>
847 847
 <tr>
848 848
 <td class='icon_td'>";
849
-                            if ($i == 4 ) {
849
+                            if ($i == 4) {
850 850
                                 $clientstest[] = "<!--";
851 851
                             }
852
-                            $clientstest[] = "<img src='../resources/images/icons/loading51.gif' id='" . $prefix2 . "srcclient$hostindex" . "_img'></td>
853
-<td id='" . $prefix2 . "srcclient$hostindex'>
854
-" . _("testing...");
852
+                            $clientstest[] = "<img src='../resources/images/icons/loading51.gif' id='".$prefix2."srcclient$hostindex"."_img'></td>
853
+<td id='" . $prefix2."srcclient$hostindex'>
854
+"._("testing...");
855 855
 
856
-                            if ($i == 4 ) {
857
-                                $clientstest[] = "-->" . _("not implemented yet");
856
+                            if ($i == 4) {
857
+                                $clientstest[] = "-->"._("not implemented yet");
858 858
                             }
859 859
                             $clientstest[] = "</td></tr></table></span>";
860 860
                             $clientstest[] = '</ol>';
861 861
                         }
862 862
                         echo '<div style="align:'.$end.';">';
863 863
                         echo join('', $resultstoprint);
864
-                        echo '<span id="' . $prefix2 . 'clientstest" style="display: none;"><p><hr><b>' . _('Checking if certificates from  CAs are accepted...') . '</b><p>' . _('A few client certificates will be tested to check if servers are resistant to some certificate problems.') . '<p>';
864
+                        echo '<span id="'.$prefix2.'clientstest" style="display: none;"><p><hr><b>'._('Checking if certificates from  CAs are accepted...').'</b><p>'._('A few client certificates will be tested to check if servers are resistant to some certificate problems.').'<p>';
865 865
                         print join('', $clientstest);
866 866
                         echo '</span>';
867 867
                         echo '</div>';
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
                 //     check if truncates/dies on Operator-Name
876 876
                 if ($my_profile !== NULL) {
877 877
                     echo "<div id='tabs-n'><fieldset class='option_container'>
878
-                <legend><strong>" . _("Live login test") . "</strong></legend>";
878
+                <legend><strong>" . _("Live login test")."</strong></legend>";
879 879
                     $prof_compl = $my_profile->getEapMethodsinOrderOfPreference(1);
880 880
                     if (count($prof_compl) > 0) {
881 881
                         $passwordReqired = FALSE;
@@ -888,34 +888,34 @@  discard block
 block discarded – undo
888 888
                                 $clientCertRequired = TRUE;
889 889
                             }
890 890
                         }
891
-                        echo "<div id='disposable_credential_container'><p>" . _("If you enter an existing login credential here, you can test the actual authentication from various checkpoints all over the world.") . "</p>
892
-                    <p>" . _("The test will use all EAP types you have set in your profile information to check whether the right CAs and server names are used, and of course whether the login with these credentials and the given EAP type actually worked. If you have set anonymous outer ID, the test will use that.") . "</p>
893
-                    <p>" . _("Note: the tool purposefully does not offer you to save these credentials, and they will never be saved in any way on the server side. Please use only <strong>temporary test accounts</strong> here; permanently valid test accounts in the wild are considered harmful!") . "</p></div>
891
+                        echo "<div id='disposable_credential_container'><p>"._("If you enter an existing login credential here, you can test the actual authentication from various checkpoints all over the world.")."</p>
892
+                    <p>" . _("The test will use all EAP types you have set in your profile information to check whether the right CAs and server names are used, and of course whether the login with these credentials and the given EAP type actually worked. If you have set anonymous outer ID, the test will use that.")."</p>
893
+                    <p>" . _("Note: the tool purposefully does not offer you to save these credentials, and they will never be saved in any way on the server side. Please use only <strong>temporary test accounts</strong> here; permanently valid test accounts in the wild are considered harmful!")."</p></div>
894 894
                     <form enctype='multipart/form-data' id='live_form' accept-charset='UTF-8'>
895 895
                     <input type='hidden' name='test_type' value='udp_login'>
896
-                    <input type='hidden' name='lang' value='" . $gui->languageInstance->getLang() . "'>
897
-                    <input type='hidden' name='profile_id' value='" . $my_profile->identifier . "'>
896
+                    <input type='hidden' name='lang' value='" . $gui->languageInstance->getLang()."'>
897
+                    <input type='hidden' name='profile_id' value='" . $my_profile->identifier."'>
898 898
                     <table id='live_tests'>";
899 899
 // if any password based EAP methods are available enable this section
900 900
                         if ($passwordReqired) {
901
-                            echo "<tr><td colspan='2'><strong>" . _("Password-based EAP types") . "</strong></td></tr>
902
-                        <tr><td>" . _("Real (inner) username:") . "</td><td><input type='text' id='username' class='mandatory' name='username'/></td></tr>";
903
-                            echo "<tr><td>" . _("Anonymous outer ID (optional):") . "</td><td><input type='text' id='outer_username' name='outer_username'/></td></tr>";
904
-                            echo "<tr><td>" . _("Password:") . "</td><td><input type='text' id='password' class='mandatory' name='password'/></td></tr>";
901
+                            echo "<tr><td colspan='2'><strong>"._("Password-based EAP types")."</strong></td></tr>
902
+                        <tr><td>" . _("Real (inner) username:")."</td><td><input type='text' id='username' class='mandatory' name='username'/></td></tr>";
903
+                            echo "<tr><td>"._("Anonymous outer ID (optional):")."</td><td><input type='text' id='outer_username' name='outer_username'/></td></tr>";
904
+                            echo "<tr><td>"._("Password:")."</td><td><input type='text' id='password' class='mandatory' name='password'/></td></tr>";
905 905
                         }
906 906
                         // ask for cert + privkey if TLS-based method is active
907 907
                         if ($clientCertRequired) {
908
-                            echo "<tr><td colspan='2'><strong>" . _("Certificate-based EAP types") . "</strong></td></tr>
909
-                        <tr><td>" . _("Certificate file (.p12 or .pfx):") . "</td><td><input type='file' id='cert' accept='application/x-pkcs12' name='cert'/></td></tr>
910
-                        <tr><td>" . _("Certificate password, if any:") . "</td><td><input type='text' id='privkey' name='privkey_pass'/></td></tr>
911
-                        <tr><td>" . _("Username, if different from certificate Subject:") . "</td><td><input type='text' id='tls_username' name='tls_username'/></td></tr>";
908
+                            echo "<tr><td colspan='2'><strong>"._("Certificate-based EAP types")."</strong></td></tr>
909
+                        <tr><td>" . _("Certificate file (.p12 or .pfx):")."</td><td><input type='file' id='cert' accept='application/x-pkcs12' name='cert'/></td></tr>
910
+                        <tr><td>" . _("Certificate password, if any:")."</td><td><input type='text' id='privkey' name='privkey_pass'/></td></tr>
911
+                        <tr><td>" . _("Username, if different from certificate Subject:")."</td><td><input type='text' id='tls_username' name='tls_username'/></td></tr>";
912 912
                         }
913
-                        echo "<tr><td colspan='2'><button id='submit_credentials'>" . _("Submit credentials") . "</button></td></tr></table></form>";
913
+                        echo "<tr><td colspan='2'><button id='submit_credentials'>"._("Submit credentials")."</button></td></tr></table></form>";
914 914
                         echo "<div id='live_login_results' style='display:none'>";
915 915
                         foreach (\config\Diagnostics::RADIUSTESTS['UDP-hosts'] as $hostindex => $host) {
916 916
                             print "<hr>";
917
-                            printf(_("Testing from: %s"), "<strong>" . \config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name'] . "</strong>");
918
-                            print "<span style='position:relative'><img src='../resources/images/icons/loading51.gif' id='live_src" . $hostindex . "_img' style='width:24px; position: absolute; $start: 20px; bottom: 0px; '></span>";
917
+                            printf(_("Testing from: %s"), "<strong>".\config\Diagnostics::RADIUSTESTS['UDP-hosts'][$hostindex]['display_name']."</strong>");
918
+                            print "<span style='position:relative'><img src='../resources/images/icons/loading51.gif' id='live_src".$hostindex."_img' style='width:24px; position: absolute; $start: 20px; bottom: 0px; '></span>";
919 919
                             print "<div id='eap_test$hostindex' class='eap_test_results'></div>";
920 920
                         }
921 921
                         echo "</div>";
@@ -930,9 +930,9 @@  discard block
 block discarded – undo
930 930
             }
931 931
 
932 932
             if (isset($_POST['comefrom'])) {
933
-                $return = htmlspecialchars_decode($_POST['comefrom']) . ( $inst_id ? "?inst_id=" . $inst_id : "" );
933
+                $return = htmlspecialchars_decode($_POST['comefrom']).($inst_id ? "?inst_id=".$inst_id : "");
934 934
                 echo "<form method='post' action='$return' accept-charset='UTF-8'>
935
-                    <button type='submit' name='submitbutton' value='" . web\lib\common\FormElements::BUTTON_CLOSE . "'>" . sprintf(_("Return to %s administrator area"), core\common\Entity::$nomenclature_idp) . "</button>"
935
+                    <button type='submit' name='submitbutton' value='".web\lib\common\FormElements::BUTTON_CLOSE."'>".sprintf(_("Return to %s administrator area"), core\common\Entity::$nomenclature_idp)."</button>"
936 936
                 . "</form>";
937 937
             }
938 938
             if ($check_realm !== FALSE) {
Please login to merge, or discard this patch.
web/diag/findRealm.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
             $expectedName = $addr['hostname'];
133 133
             $protocols = [];
134 134
             if (isset($addr['protocols'])) {
135
-                foreach($addr['protocols'] as $protocol) {
135
+                foreach ($addr['protocols'] as $protocol) {
136 136
                     if ($protocol['enabled']) {
137 137
                         $protocols[] = $protocol['type'];
138 138
                     }
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 $json_data = json_encode($returnArray);
214 214
 
215 215
 if ($token) {
216
-    $loggerInstance->debug(4, 'JSON data written to ' .$jsonDir.'/'.$token);
216
+    $loggerInstance->debug(4, 'JSON data written to '.$jsonDir.'/'.$token);
217 217
     file_put_contents($jsonDir.'/'.$token.'/realm', $json_data);
218 218
 }
219 219
 echo($json_data);
Please login to merge, or discard this patch.
core/diag/RFC6614Tests.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -168,27 +168,27 @@  discard block
 block discarded – undo
168 168
     {
169 169
         // it could match CN or sAN:DNS, we don't care which
170 170
         if (isset($this->TLS_CA_checks_result[$host]['certdata']['subject'])) {
171
-            $this->loggerInstance->debug(4, "Checking expected server name " . $this->expectedName . 
172
-                    " against Subject: " . $this->TLS_CA_checks_result[$host]['certdata']['subject']);
171
+            $this->loggerInstance->debug(4, "Checking expected server name ".$this->expectedName. 
172
+                    " against Subject: ".$this->TLS_CA_checks_result[$host]['certdata']['subject']);
173 173
             // we are checking against accidental misconfig, not attacks, so loosely checking against end of string is appropriate
174
-            if (preg_match("/CN=" . $this->expectedName . "/", $this->TLS_CA_checks_result[$host]['certdata']['subject']) === 1) {
174
+            if (preg_match("/CN=".$this->expectedName."/", $this->TLS_CA_checks_result[$host]['certdata']['subject']) === 1) {
175 175
                 return TRUE;
176 176
             }
177 177
         }
178 178
         if (isset($this->TLS_CA_checks_result[$host]['certdata']['extensions']['subjectaltname'])) {
179
-            $this->loggerInstance->debug(4, "Checking expected server name " . $this->expectedName . " against sANs: ");
179
+            $this->loggerInstance->debug(4, "Checking expected server name ".$this->expectedName." against sANs: ");
180 180
             $this->loggerInstance->debug(4, $this->TLS_CA_checks_result[$host]['certdata']['extensions']['subjectaltname']);
181 181
             $testNames = $this->TLS_CA_checks_result[$host]['certdata']['extensions']['subjectaltname'];
182 182
             if (!is_array($testNames)) {
183 183
                 $testNames = [$testNames];
184 184
             }
185 185
             foreach ($testNames as $oneName) {
186
-                if (preg_match("/" . $this->expectedName . "/", $oneName) === 1) {
186
+                if (preg_match("/".$this->expectedName."/", $oneName) === 1) {
187 187
                     return TRUE;
188 188
                 }
189 189
             }
190 190
         }
191
-        $this->loggerInstance->debug(3, "Tried to check expected server name " . $this->expectedName . " but neither CN nor sANs matched.");
191
+        $this->loggerInstance->debug(3, "Tried to check expected server name ".$this->expectedName." but neither CN nor sANs matched.");
192 192
 
193 193
         $this->TLS_CA_checks_result[$host]['cert_oddity'] = RADIUSTests::CERTPROB_DYN_SERVER_NAME_MISMATCH;
194 194
         return FALSE;
@@ -218,9 +218,9 @@  discard block
 block discarded – undo
218 218
                 $this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k]['status'] = $cert['status'];
219 219
                 $this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k]['message'] = $this->TLS_certkeys[$cert['status']];
220 220
                 $this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k]['expected'] = $cert['expected'];
221
-                $add = ' -cert ' . ROOT . '/config/cli-certs/' . $cert['public'] . ' -key ' . ROOT . '/config/cli-certs/' . $cert['private'];
222
-                if (!file_exists(ROOT . '/config/cli-certs/' . $cert['public']) ||!file_exists(ROOT . 
223
-                        '/config/cli-certs/' . $cert['private'])) {
221
+                $add = ' -cert '.ROOT.'/config/cli-certs/'.$cert['public'].' -key '.ROOT.'/config/cli-certs/'.$cert['private'];
222
+                if (!file_exists(ROOT.'/config/cli-certs/'.$cert['public']) || !file_exists(ROOT. 
223
+                        '/config/cli-certs/'.$cert['private'])) {
224 224
                     $this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k]['finalerror'] = 2;
225 225
                     continue;
226 226
                 }
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
                 if (in_array("TLS1.3", $protocols) && count($protocols) > 1) {
232 232
                     $prot .= ' -no_tls1_3';
233 233
                 }
234
-                $add .= ' ' . $prot;
234
+                $add .= ' '.$prot;
235 235
                 $opensslbabble = $this->execOpensslClient($host, $add, $this->TLS_clients_checks_result[$host]['ca'][$type]['certificate'][$k]);
236 236
                 $res = $this->opensslClientsResult($host, $opensslbabble, $this->TLS_clients_checks_result, $type, $k);
237 237
                 if ($cert['expected'] == 'PASS') {
@@ -273,11 +273,11 @@  discard block
 block discarded – undo
273 273
 // but code analysers want this more explicit, so here is this extra
274 274
 // call to escapeshellarg()
275 275
         $escapedHost = escapeshellarg($host);
276
-        $this->loggerInstance->debug(4, \config\Master::PATHS['openssl'] . " s_client -connect " . $escapedHost . " -CApath " . ROOT . "/config/ca-certs/$this->consortium/ $arg 2>&1\n");
276
+        $this->loggerInstance->debug(4, \config\Master::PATHS['openssl']." s_client -connect ".$escapedHost." -CApath ".ROOT."/config/ca-certs/$this->consortium/ $arg 2>&1\n");
277 277
         $time_start = microtime(true);
278 278
         $opensslbabble = [];
279 279
         $result = 999; // likely to become zero by openssl; don't want to initialise to zero, could cover up exec failures
280
-        exec(\config\Master::PATHS['openssl'] . " s_client -connect " . $escapedHost . " -CApath " . ROOT . "/config/ca-certs/$this->consortium/ $arg 2>&1", $opensslbabble, $result);
280
+        exec(\config\Master::PATHS['openssl']." s_client -connect ".$escapedHost." -CApath ".ROOT."/config/ca-certs/$this->consortium/ $arg 2>&1", $opensslbabble, $result);
281 281
         $time_stop = microtime(true);
282 282
         $testresults['time_millisec'] = floor(($time_stop - $time_start) * 1000);
283 283
         $testresults['returncode'] = $result;
Please login to merge, or discard this patch.
core/diag/RADIUSTestsUI.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
          <table><tr>
293 293
          <td class='icon_td'>";
294 294
         $out[] = "<img src='".$this->stateIcons[$this->globalLevelStatic]."' id='main_static_ico' class='icon'></td><td id='main_static_result'>".
295
-                            $this->globalInfo[$this->globalLevelStatic].' '. _("See the appropriate tab for details.").'</td>
295
+                            $this->globalInfo[$this->globalLevelStatic].' '._("See the appropriate tab for details.").'</td>
296 296
          </tr></table>';
297 297
         if ($this->naptr > 0) {
298 298
             $out[] = "<hr><strong>"._("Dynamic connectivity tests")."</strong>
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 <td class='icon_td'><img src='".$this->stateIcons[$result->level]."' id='src".$hostindex."_img'></td>
324 324
 <td id='src$hostindex' colspan=2>
325 325
 ";
326
-            $out[] = '<strong>'.($result->server ? $result->server : _("Connected to undetermined server")).'</strong><br/>'.sprintf (_("elapsed time: %sms."), $result->time_millisec).'<p>'.$result->message.'</p>';
326
+            $out[] = '<strong>'.($result->server ? $result->server : _("Connected to undetermined server")).'</strong><br/>'.sprintf(_("elapsed time: %sms."), $result->time_millisec).'<p>'.$result->message.'</p>';
327 327
                     
328 328
             if ($result->level > \core\common\Entity::L_OK && property_exists($result, 'cert_oddities')) {
329 329
                 foreach ($result->cert_oddities as $oddities) {
@@ -373,10 +373,10 @@  discard block
 block discarded – undo
373 373
             if (isset($this->protocolsMap[$capath->IP]) && $this->protocolsMap[$capath->IP] != '') {
374 374
                 $prots = explode(';', $this->protocolsMap[$capath->IP]);
375 375
                 if (!empty($prots)) {
376
-                    $capathtest[] = ' ' . _("supported TLS protocols: ");
376
+                    $capathtest[] = ' '._("supported TLS protocols: ");
377 377
                     $capathtest[] = implode(', ', $prots);
378 378
                     if (!in_array("TLS1.3", $prots)) {
379
-                        $capathtest[] =  ' ' . '<font color="red">' . _("not supported: ") . 'TLS1.3</font>';
379
+                        $capathtest[] = ' '.'<font color="red">'._("not supported: ").'TLS1.3</font>';
380 380
                     }
381 381
                 }
382 382
             }
@@ -399,7 +399,7 @@  discard block
 block discarded – undo
399 399
                 if ($capath->certdata->validTo) {
400 400
                     $certdesc .= '<li>'.$this->certFields['validTo'].' '.
401 401
                             date_create_from_format('ymdGis', 
402
-                                    substr($capath->certdata->validTo, 0, -1))->format('Y-m-d H:i:s'). ' UTC';
402
+                                    substr($capath->certdata->validTo, 0, -1))->format('Y-m-d H:i:s').' UTC';
403 403
                 }
404 404
                 if ($capath->certdata->extensions) {
405 405
                     if ($capath->certdata->extensions->subjectaltname) {                     
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
             } else {
423 423
                 $certdesc = '<br>';
424 424
             }
425
-            $capathtest[] = '<div>'.($capath->message!='' ? $capath->message : _('Test failed')).'</div>'.$more;
425
+            $capathtest[] = '<div>'.($capath->message != '' ? $capath->message : _('Test failed')).'</div>'.$more;
426 426
             $capathtest[] = '</td>
427 427
 </tr>
428 428
 </table>';
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
                         $srefused = 0;
450 450
                         $cliinfo = '';
451 451
                         $cliinfo .= '<li>'._('Client certificate').' <b>'.$ca->clientcertinfo->from.
452
-                                    '</b>'.', '.$ca->clientcertinfo->message .
452
+                                    '</b>'.', '.$ca->clientcertinfo->message.
453 453
                                     '<br> (CA: '.$ca->clientcertinfo->issuer.')<ul>';
454 454
                         foreach ($ca->certificate as $certificate) {
455 455
                             if ($certificate->returncode == \core\diag\RADIUSTests::RETVAL_CONNECTION_REFUSED) {
@@ -515,7 +515,7 @@  discard block
 block discarded – undo
515 515
                 } else {
516 516
                     $cliinfo = _('Test failed');
517 517
                     $clientstest[] = "<table><tr><td class='icon_td' id='srcclient".$hostindex."_img'><img src='".
518
-                                    $this->stateIcons[\core\common\Entity::L_WARN]."'></td>" .
518
+                                    $this->stateIcons[\core\common\Entity::L_WARN]."'></td>".
519 519
                                     "<td id='srcclient$hostindex'>$cliinfo</td></tr></table>";
520 520
                 }
521 521
             } else {
Please login to merge, or discard this patch.
core/diag/RFC7585Tests.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -438,7 +438,7 @@  discard block
 block discarded – undo
438 438
             $this->relevantNAPTRhostnameResolution();
439 439
         }
440 440
         foreach ($this->NAPTR_hostname_records as $hostindex => $addr) {
441
-            $host = ($addr['family'] == "IPv6" ? "[" : "") . $addr['IP'] . ($addr['family'] == "IPv6" ? "]" : "") . ":" . $addr['port'];
441
+            $host = ($addr['family'] == "IPv6" ? "[" : "").$addr['IP'].($addr['family'] == "IPv6" ? "]" : "").":".$addr['port'];
442 442
             $this->NAPTR_hostname_records[$hostindex]['protocols'] = $this->execSslscan($hostindex, $host);
443 443
             foreach ($this->NAPTR_hostname_records[$hostindex]['protocols'] as $protocol) {
444 444
                 if ($protocol['type'] == 'TLS1.3' && $protocol['enabled'] == 1) {
@@ -458,13 +458,13 @@  discard block
 block discarded – undo
458 458
      */
459 459
     private function execSslscan($hostindex, $host)
460 460
     {
461
-        $this->loggerInstance->debug(4, \config\Master::PATHS['sslscan'] . " --no-heartbleed --no-fallback --connect-timeout=5 --no-ciphersuites --xml=- " . $host . "\n");
461
+        $this->loggerInstance->debug(4, \config\Master::PATHS['sslscan']." --no-heartbleed --no-fallback --connect-timeout=5 --no-ciphersuites --xml=- ".$host."\n");
462 462
         $sslscanbabble = [];
463 463
         $result = 999; // likely to become zero by openssl; don't want to initialise to zero, could cover up exec failures
464
-        exec(\config\Master::PATHS['sslscan'] . " --no-heartbleed --no-fallback --connect-timeout=5 --no-ciphersuites --xml=- " . $host ." 2>&1", $sslscanbabble, $result);
464
+        exec(\config\Master::PATHS['sslscan']." --no-heartbleed --no-fallback --connect-timeout=5 --no-ciphersuites --xml=- ".$host." 2>&1", $sslscanbabble, $result);
465 465
         $this->loggerInstance->debug(4, 'sslscan result '.implode($sslscanbabble));
466 466
         $xml = simplexml_load_string(implode($sslscanbabble));  
467
-        $resarray = json_decode(json_encode((array)$xml),true);
467
+        $resarray = json_decode(json_encode((array) $xml), true);
468 468
         $prots = [];
469 469
         if (!isset($resarray['ssltest'])) {
470 470
             $this->NAPTR_hostname_records[$hostindex]['unavailable'] = 1;
Please login to merge, or discard this patch.