Skip to content

Commit 351c2b6

Browse files
committed
PHP 8 fixes
1 parent 0023b22 commit 351c2b6

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

interface/lib/classes/listform_actions.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public function prepareDataRow($rec)
189189
//* substitute value for select fields
190190
if(is_array($app->listform->listDef['item']) && count($app->listform->listDef['item']) > 0) {
191191
foreach($app->listform->listDef['item'] as $field) {
192-
if($rec['active'] == 'n') $rec['warn_inactive'] = 'y';
192+
if(isset($rec['active']) && $rec['active'] == 'n') $rec['warn_inactive'] = 'y';
193193
$key = $field['field'];
194194
if(isset($field['formtype']) && $field['formtype'] == 'SELECT') {
195195
if(strtolower($rec[$key]) == 'y' or strtolower($rec[$key]) == 'n') {

interface/lib/classes/tform_base.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1585,7 +1585,7 @@ function showForm() {
15851585

15861586
// Set form title
15871587
$form_hint = $this->lng($this->formDef["title"]);
1588-
if($this->formDef["description"] != '') $form_hint .= '<div class="pageForm_description">'.$this->lng($this->formDef["description"]).'</div>';
1588+
if(isset($this->formDef["description"]) && $this->formDef["description"] != '') $form_hint .= '<div class="pageForm_description">'.$this->lng($this->formDef["description"]).'</div>';
15891589
$app->tpl->setVar('form_hint', $form_hint);
15901590

15911591
// Set Wordbook for this form

interface/web/client/client_edit.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function onSubmit() {
119119
$this->oldTemplatesAssigned = array();
120120
}
121121

122-
$this->_template_additional = explode('/', $this->dataRecord['template_additional']);
122+
$this->_template_additional = (isset($this->dataRecord['template_additional']) && $this->dataRecord['template_additional'] != '')?explode('/', $this->dataRecord['template_additional']):array();
123123
$this->dataRecord['template_additional'] = '';
124124

125125
parent::onSubmit();
@@ -169,7 +169,7 @@ function onShowEnd() {
169169
// old style
170170
$sql = "SELECT template_additional FROM client WHERE client_id = ?";
171171
$result = $app->db->queryOneRecord($sql, $this->id);
172-
$tplAdd = explode("/", $result['template_additional']);
172+
$tplAdd = (isset($result['template_additional']) && $result['template_additional'] != '')?explode("/", $result['template_additional']):array();
173173
$text = '';
174174
foreach($tplAdd as $item){
175175
if (trim($item) != ''){
@@ -293,7 +293,7 @@ function onAfterInsert() {
293293
$app->auth->add_group_to_user($_SESSION['s']['user']['userid'], $groupid);
294294
$app->db->query("UPDATE client SET parent_client_id = ? WHERE client_id = ?", $_SESSION['s']['user']['client_id'], $this->id);
295295
} else {
296-
if($this->dataRecord['parent_client_id'] > 0) {
296+
if(isset($this->dataRecord['parent_client_id']) && $this->dataRecord['parent_client_id'] > 0) {
297297
//* get userid of the reseller and add it to the group of the client
298298
$tmp = $app->db->queryOneRecord("SELECT sys_user.userid FROM sys_user,sys_group WHERE sys_user.default_group = sys_group.groupid AND sys_group.client_id = ?", $this->dataRecord['parent_client_id']);
299299
$app->auth->add_group_to_user($tmp['userid'], $groupid);
@@ -304,14 +304,14 @@ function onAfterInsert() {
304304

305305
//* Set the default servers
306306
$tmp = $app->getconf->get_global_config('mail');
307-
$default_mailserver = $app->functions->intval($tmp['default_mailserver']);
307+
$default_mailserver = (isset($tmp['default_mailserver']))?$app->functions->intval($tmp['default_mailserver']):0;
308308
if (!$default_mailserver) {
309309
$tmp = $app->db->queryOneRecord('SELECT server_id FROM server WHERE mail_server = 1 AND mirror_server_id = 0 LIMIT 0,1');
310310
$default_mailserver = $app->functions->intval($tmp['server_id']);
311311
}
312312
$tmp = $app->getconf->get_global_config('sites');
313-
$default_webserver = $app->functions->intval($tmp['default_webserver']);
314-
$default_dbserver = $app->functions->intval($tmp['default_dbserver']);
313+
$default_webserver = (isset($tmp['default_webserver']))?$app->functions->intval($tmp['default_webserver']):0;
314+
$default_dbserver = (isset($tmp['default_dbserver']))?$app->functions->intval($tmp['default_dbserver']):0;
315315
if (!$default_webserver) {
316316
$tmp = $app->db->queryOneRecord('SELECT server_id FROM server WHERE web_server = 1 AND mirror_server_id = 0 LIMIT 0,1');
317317
$default_webserver = $app->functions->intval($tmp['server_id']);
@@ -321,7 +321,7 @@ function onAfterInsert() {
321321
$default_dbserver = $app->functions->intval($tmp['server_id']);
322322
}
323323
$tmp = $app->getconf->get_global_config('dns');
324-
$default_dnsserver = $app->functions->intval($tmp['default_dnsserver']);
324+
$default_dnsserver = (isset($tmp['default_dnsserver']))?$app->functions->intval($tmp['default_dnsserver']):0;
325325
if (!$default_dnsserver) {
326326
$tmp = $app->db->queryOneRecord('SELECT server_id FROM server WHERE dns_server = 1 AND mirror_server_id = 0 LIMIT 0,1');
327327
$default_dnsserver = $app->functions->intval($tmp['server_id']);

interface/web/mailuser/mail_user_autoresponder_edit.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ function onSubmit() {
6464

6565
//* if autoresponder checkbox not selected, do not save dates
6666
if (!isset($_POST['autoresponder']) && array_key_exists('autoresponder_start_date', $_POST)) {
67-
$this->dataRecord['autoresponder_start_date'] = array_map(function($item) { return 0;}), $this->dataRecord['autoresponder_start_date']);
68-
$this->dataRecord['autoresponder_end_date'] = array_map(function($item) { return 0;}), $this->dataRecord['autoresponder_end_date']);
67+
$this->dataRecord['autoresponder_start_date'] = array_map(function($item) { return 0;}, $this->dataRecord['autoresponder_start_date']);
68+
$this->dataRecord['autoresponder_end_date'] = array_map(function($item) { return 0;}, $this->dataRecord['autoresponder_end_date']);
6969

7070
/* To be used when we go to PHP 7.x as min PHP version
7171
$this->dataRecord['autoresponder_start_date'] = array_map( function ('$item') { 'return 0;' }, $this->dataRecord['autoresponder_start_date']);

0 commit comments

Comments
 (0)