Skip to content

Bug fixing php7 #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 17 commits into
base: develop
Choose a base branch
from

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.

@@ -356,7 +356,7 @@ function get_parent_directories($iddirectory, $idclient) {
// -> else: only $file is used as ID
//
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.

@@ -730,15 +730,15 @@ function con_create_site_meta_from_idcatside($idclient, $idlang_current, $idcats
//create idside
$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.

@@ -938,7 +938,7 @@ function insert_cssrelation( $idcss, $idcssfile ) {
$sql = 'INSERT INTO ' . $cms_db['css_upl'] . ' (idcss, idupl) VALUES ';
$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.

@@ -80,6 +80,7 @@
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.

@@ -172,6 +172,9 @@ function mip_forms_abstrakt($in, $input)
$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