Skip to content

Commit 5225264

Browse files
committed
PHP8 updates
1 parent 89a897f commit 5225264

6 files changed

Lines changed: 266 additions & 250 deletions

File tree

‎lib/general.class.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,14 @@ function redirect($url, $owner = "", $no_sid = 0)
147147
$owner->redirect($url);
148148
} else {
149149
$param_str = "";
150-
151150
if (!$no_sid) {
152151
$replaceStr = $_SERVER['PHP_SELF'] . '?' . session_name() . '=' . session_id();
153-
$replaceStr .= '&pd=' . $param_str . '&md=' . $owner->name . '&inst=' . $owner->instance . '&';
154-
152+
$replaceStr .= '&pd=' . $param_str;
153+
if (is_object($owner)) {
154+
$replaceStr .= '&md=' . $owner->name . '&inst=' . $owner->instance . '&';
155+
}
155156
$url = str_replace('?', $replaceStr, $url);
156157
}
157-
158158
$url = "Location:$url\n\n";
159159
$session->save();
160160
header($url);

‎modules/app_player/app_player.class.php‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ function admin(&$out)
143143
}
144144
$this->usual($out);
145145
$out['MODE'] = $this->mode;
146-
$out['ENABLED'] = (int)($this->config['ENABLED']);
146+
$out['ENABLED'] = (int)(isset($this->config['ENABLED'])?$this->config['ENABLED']:'');
147147
}
148148

149149
/**
@@ -223,14 +223,14 @@ function usual(&$out)
223223
if ($ajax) {
224224

225225
// Command
226-
if ($this->command) {
226+
if (isset($this->command) && $this->command) {
227227
$command = $this->command;
228228
} else {
229229
$command = trim(gr('command'));
230230
}
231231

232232
// Param
233-
if ($this->param) {
233+
if (isset($this->param) && $this->param) {
234234
$param = $this->param;
235235
} else {
236236
$param = trim(gr('param'));
@@ -348,7 +348,7 @@ function usual(&$out)
348348
}
349349

350350
// Return json
351-
if ($this->intCall) {
351+
if (isset($this->intCall) && $this->intCall) {
352352
$this->json = $json;
353353
} else {
354354
$session->save();

‎modules/settings/settings_search.inc.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
);
7474
foreach ($options as $k => $v) {
7575
$tmp = SQLSelectOne("SELECT ID FROM settings WHERE NAME LIKE '" . $k . "'");
76-
if (!$tmp['ID']) {
76+
if (!isset($tmp['ID'])) {
7777
$tmp = array();
7878
$tmp['NAME'] = $k;
7979
$tmp['TITLE'] = $v;

‎modules/textfiles/textfiles.class.php‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,13 +162,13 @@ function admin(&$out)
162162
$data = LoadFile(ROOT . 'cms/texts/' . $file . ".txt");
163163
$out['DATA'] = htmlspecialchars($data);
164164
}
165-
$out['FILE'] = $file;
166-
$out['FILE_URL'] = urlencode($out['FILE']);
167-
168-
if (preg_match('/panelBlock/', $file)) {
169-
$out['ADD_EDITOR'] = 1;
170-
if (!$out['DATA']) {
171-
$out['DATA'] = <<<FF
165+
if ($file) {
166+
$out['FILE'] = $file;
167+
$out['FILE_URL'] = urlencode($out['FILE']);
168+
if (preg_match('/panelBlock/', $file)) {
169+
$out['ADD_EDITOR'] = 1;
170+
if (!isset($out['DATA'])) {
171+
$out['DATA'] = <<<FF
172172
<div class="panel panel-default">
173173
<div class="panel-heading">
174174
Panel title
@@ -178,10 +178,13 @@ function admin(&$out)
178178
</div>
179179
</div>
180180
FF;
181+
}
181182
}
183+
182184
}
183185

184186

187+
185188
}
186189

187190
}

0 commit comments

Comments
 (0)