Ah yes. The commit indeed concerns two different files then the document.parser.class.inc.php. The original bug report mentioned code that came from this class (or at least the same code is used there), so I assumed the commit involved this as well. Sorry for this. No custom code is involved though.
The code/function from document.parser.class.inc.php that causes the bug in the Snippets and also shows the use of raw mysql functions:
# Add an a alert message to the system event log
function logEvent($evtid, $type, $msg, $source= 'Parser') {
$msg= mysql_escape_string($msg);
$source= mysql_escape_string($source);
$evtid= intval($evtid);
if ($type < 1) {
$type= 1;
}
elseif ($type > 3) {
$type= 3; // Types: 1 = information, 2 = warning, 3 = error
}
$sql= "INSERT INTO " . $this->getFullTableName("event_log") . " (eventid,type,createdon,source,description,user) " .
"VALUES($evtid,$type," . time() . ",'$source','$msg','" . $this->getLoginUserID() . "')";
$ds= @mysql_query($sql);
if (!$ds) {
echo "Error while inserting event log into database.";
exit();
}
}
As the code part above shows, mysql_* functions are used while it should use $this->db->*. This also causes any snippet that creates a new database connection (either by making a new DBAPI instance or using mysql_* functions) to bug out the above mentioned function. The database connection that is used in the above function will use the newly created one.
Replacing
with
$ds = $this->db->query($sql);
fixes the snippet problem for now.
I hope this provides enough information.