Skip to content

Bug fixing php7#28

Open
Gesundheitsminister wants to merge 17 commits intosefrengo-cms:developfrom
Gesundheitsminister:bug_fixing_php7
Open

Bug fixing php7#28
Gesundheitsminister wants to merge 17 commits intosefrengo-cms:developfrom
Gesundheitsminister:bug_fixing_php7

Conversation

@Gesundheitsminister
Copy link
Contributor

  • wrong mysqli links
  • sql error on page copy
  • session fix

Copy link
Member

@thinkh thinkh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your bugfixes. I have some comments and questions before merging this PR.

//
function get_file($file, $idclient = '', $iddirectory = '', $type = 1) {
if (empty($file)) return ''; // missing fileid
if (empty($file)) return array(); // missing fileid
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you use array() instead of [] in this file (2 times)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to be compatible to php < 5.4. I dont know if this still makes sense.

$sql = "INSERT INTO ".$cms_db['side']." (idclient) VALUES ('$idclient')";
$db->query($sql);
$idside_to = mysqli_insert_id($this->db->Link_ID);
$idside_to = mysqli_insert_id($GLOBALS['db']->Link_ID);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not using $db->Link_ID?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$this->db is not set in this function. $GLOBALS['db'] is reliable.

$sql .= '(' . $idcss . ', ' . $idcssfile . ')';
$db->query($sql);
return mysqli_insert_id($this->db->Link_ID);
return mysqli_insert_id($GLOBALS['db']->Link_ID);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here: Why not using $db->Link_ID?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same problem. $this->db is not accessible everywhere.

mip_forms_ob_start();
eval(' ?>' . $default);
$default_arr = mip_forms_get_array();
//$cms_mod = empty($cms_mod) ? : $cms_mod;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have removed it. Comes with the next update.

$spaces .= sprintf($mip_forms_tab['tab'], '&nbsp;');
}

$mip_forms_tab['left_width'] = empty($mip_forms_tab['left_width']) ? 0 : $mip_forms_tab['left_width'];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this part do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is important that $mip_forms_tab['left_width'] is initialised with an integer. PHP7 will miscalculate otherwise.

@thinkh thinkh changed the base branch from master to develop December 26, 2017 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants