Skip to content

Commit

Permalink
Update mysql_connect.inc.php
Browse files Browse the repository at this point in the history
This one patch, patches all SQL Injection that I found
  • Loading branch information
stevenseeley committed Mar 7, 2016
1 parent 1759412 commit 945a9dc
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions include/lib/mysql_connect.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,8 @@ function my_null_slashes($string) {
$addslashes = 'my_add_null_slashes';
$stripslashes = 'stripslashes';
} else {
if(defined('MYSQLI_ENABLED')){
// mysqli_real_escape_string requires 2 params, breaking wherever
// current $addslashes with 1 param exists. So hack with trim and
// manually run mysqli_real_escape_string requires during sanitization below
$addslashes = 'trim';
}else{
$addslashes = 'mysql_real_escape_string';
}
// if get_magic_quotes_gpc is off, we set our own handler
$addslashes = 'mysql_real_escape_string';
$stripslashes = 'my_null_slashes';
}

Expand Down Expand Up @@ -406,4 +400,4 @@ function at_field_name($result, $i){
}

////
?>
?>

2 comments on commit 945a9dc

@gregrgay
Copy link
Collaborator

Choose a reason for hiding this comment

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

Unfortunately have to find another way to do this. Anywhere there's HTML it breaks things.

@stevenseeley
Copy link
Contributor Author

Choose a reason for hiding this comment

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

due to $addslashes right?

Please sign in to comment.