Explorar o código

Fix few php error caused by the upgrade to 8.1.x (#2515)

Jaap Marcus %!s(int64=3) %!d(string=hai) anos
pai
achega
e6b393a9c4
Modificáronse 3 ficheiros con 16 adicións e 7 borrados
  1. 1 0
      web/add/key/index.php
  2. 14 6
      web/list/web-log/index.php
  3. 1 1
      web/templates/pages/list_weblog.html

+ 1 - 0
web/add/key/index.php

@@ -27,6 +27,7 @@ if (!empty($_POST['ok'])) {
             $data = json_decode(implode('', $output), true);
             unset($output);
             $keylist = array();
+            $idlist = array();
             foreach ($data as $key => $value) {
                 $idlist[] = trim($data[$key]['ID']);
                 $keylist[] = trim($data[$key]['KEY']);

+ 14 - 6
web/list/web-log/index.php

@@ -2,17 +2,25 @@
 
 include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
 
+$TAB = "WEB";
+
+$v_domain = escapeshellarg($_GET['domain']);
+$type = 'access';
+if ($_GET['type'] == 'access') {
+    $type = 'access';
+}
+if ($_GET['type'] == 'error') {
+    $type = 'error';
+}
 // Header
 include($_SERVER['DOCUMENT_ROOT'].'/templates/pages/list_weblog.html');
 
-$v_domain = escapeshellarg($_GET['domain']);
-if ($_GET['type'] == 'access') $type = 'access';
-if ($_GET['type'] == 'error') $type = 'error';
 
-exec (HESTIA_CMD."v-list-web-domain-".$type."log $user ".$v_domain, $output, $return_var);
 
-if ($return_var == 0 ) {
-    foreach($output as $file) {
+exec(HESTIA_CMD."v-list-web-domain-".$type."log $user ".$v_domain, $output, $return_var);
+
+if ($return_var == 0) {
+    foreach ($output as $file) {
         echo htmlentities($file) . "\n";
     }
 }

+ 1 - 1
web/templates/pages/list_weblog.html

@@ -37,5 +37,5 @@
 		</div>
 	</div>
 
-	<div style="margin-left: auto; margin-right: auto; padding-top: 80px; width: 1020px;"><?=_('Last 70 lines of %s.%s.log',htmlentities($_GET['domain']),htmlentities($_GET['type'])) ;?></div>
+	<div style="margin-left: auto; margin-right: auto; padding-top: 80px; width: 1020px;"><?=sprintf(_('Last 70 lines of %s.%s.log'),htmlentities($_GET['domain']),htmlentities($type)) ;?></div>
 	<pre style="width: 1020px; margin-left: auto; margin-right: auto;" class="console-output">