Today, trying to kill the pains of my personal world, I found a bug and decided to submit a patch for the open source project postfixadmin. Below is this memorable, first contribution to the open source community:
Hi,
Couldn’t find anywhere to post this, the svn-repos seems to be down and the bugtraq as well, so here it is in a mail – hope it’s usable!
I had problems connecting to a mysql 5.0.33 on another machine (via TCP) until i did this hack (don’t mind the file date stamps!):
[code lang="diff"]
--- functions.inc.php.orig Wed Mar 21 12:30:33 2007
+++ functions.inc.php Wed Mar 21 12:23:16 2007
@@ -128,8 +128,9 @@ function escape_string ($string)
global $CONF;
if (get_magic_quotes_gpc () == 0)
{
+ $link = db_connect();
if ($CONF['database_type'] == "mysql") $escaped_string = mysql_real_escape_string ($string);
- if ($CONF['database_type'] == "mysqli") $escaped_string = mysqli_real_escape_string ($string);
+ if ($CONF['database_type'] == "mysqli") $escaped_string = mysqli_real_escape_string ($link, $string);
if ($CONF['database_type'] == "pgsql") $escaped_string = pg_escape_string ($string);
}
else
[/code]
Newest comments