Issues (994)

etc/superuser/index.php (2 issues)

Labels
Severity
1
<?php include __DIR__ . '/breadcrumb.php'; ?>
2
3
<section>
4
  <div class="card mb-3">
5
    <div class="card-body">
6
      <span class="card-label">CONFIGURATION</span>
7
      <form action="" method="post" enctype="application/json">
8
        <input type="hidden" name="config">
9
        <div class="form-row mb-4">
10
          <div class="col">
11
            <div class="md-form">
12
              <input type="text" name="database[user]" value="<?= get_db()['user'] ?>" no-save class="form-control">
13
              <label for="">User</label>
14
            </div>
15
          </div>
16
          <div class="col">
17
            <div class="md-form">
18
              <input type="text" name="database[pass]" value="<?= get_db()['pass'] ?>" no-save class="form-control">
19
              <label for="">Password</label>
20
            </div>
21
          </div>
22
        </div>
23
        <div class="form-row mb-4">
24
          <div class="col">
25
            <div class="md-form">
26
              <input type="text" name="database[dbname]" value="<?= get_db()['dbname'] ?>" no-save class="form-control">
27
              <label for="">Database</label>
28
            </div>
29
          </div>
30
          <div class="col">
31
            <div class="md-form">
32
              <input type="text" name="database[host]" value="<?= get_db()['host'] ?>" no-save class="form-control">
33
              <label for="">Host</label>
34
            </div>
35
          </div>
36
          <div class="col">
37
            <div class="md-form">
38
              <input type="text" name="database[port]" value="<?= get_db()['port'] ?>" no-save class="form-control">
39
              <label for="">Port</label>
40
            </div>
41
          </div>
42
        </div>
43
        <hr class="hr-text" data-content="Google Api">
44
        <div class="form-row mb-4">
45
          <div class="col">
46
            <div class="md-form">
47
              <input type="text" name="google[key]" value="<?= get_conf()['google']['key'] ?>" no-save class="form-control">
48
              <label for="">Google Key</label>
49
            </div>
50
          </div>
51
52
          <div class="col">
53
            <div class="md-form">
54
              <input type="text" name="google[secret]" value="<?= get_conf()['google']['secret'] ?>" no-save class="form-control">
55
              <label for="">Google Secret</label>
56
            </div>
57
          </div>
58
        </div>
59
        <div class="form-row mb-4">
60
          <div class="col">
61
            <div class="md-form">
62
              <input type="text" name="google[client]" value="<?= get_conf()['google']['client'] ?>" no-save class="form-control">
63
              <label for="">Google Client</label>
64
            </div>
65
          </div>
66
        </div>
67
        <button type="submit" class="btn btn-block text-white purple"><i class="fad fa-save"></i></button>
68
      </form>
69
    </div>
70
  </div>
71
</section>
72
73
74
<section>
75
  <div class="card">
76
    <div class="card-body">
77
      <div class="card-label">BETA</div>
78
      <div class="mb-2">
79
        <div class="row">
80
          <div class="col">
81
            Refresh Cache
82
          </div>
83
          <div class="col">
84
            <button class="btn" id="reload" data-toggle="tooltip" title="clear browser cache" onclick="clear_cache()"><i class="fad fa-sync"></i></button>
85
          </div>
86
        </div>
87
      </div>
88
89
      <div class="mb-2">
90
        <div class="row">
91
          <div class="col">
92
            HTACCESS Cache Mode
93
          </div>
94
          <div class="col">
95
            <div class="switch">
96
              <label>
97
                Off
98
                <input type="checkbox">
99
                <span class="lever"></span> On
100
              </label>
101
            </div>
102
          </div>
103
        </div>
104
      </div>
105
106
      <div class="mb-2">
107
        <div class="p-2">
108
          <?php
109
          $OS = \MVC\helper::is_windows() ? 'WINDOWS' : 'LINUX';
110
          if (\MVC\helper::is_windows()) {
111
            $output = shell('ipconfig -all');
112
          } else {
113
            $output = shell("ifconfig | grep 'inet ' | grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'");
114
          }
115
          ?>
116
          <pre title="<?= $OS ?>"><?= str_replace('\n', "\n", \JSON\json::json(explode("\n", $output), false, true)) ?></pre>
0 ignored issues
show
Are you sure the usage of JSON\json::json(explode(... $output), false, true) targeting JSON\json::json() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
It seems like $output can also be of type null; however, parameter $string of explode() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

116
          <pre title="<?= $OS ?>"><?= str_replace('\n', "\n", \JSON\json::json(explode("\n", /** @scrutinizer ignore-type */ $output), false, true)) ?></pre>
Loading history...
117
        </div>
118
      </div>
119
    </div>
120
  </div>
121
</section>