Commit 581f0ff3 authored by Dave Reid's avatar Dave Reid Committed by greggles

Issue #790586 by Dave Reid, greggles: Followup to fix notices, install...

Issue #790586 by Dave Reid, greggles: Followup to fix notices, install failure, failing tests ON Add more secret info to the hash in the install function
parent 74239269
......@@ -16,12 +16,12 @@ function comment_notify_install() {
$comments_select->addField('c', 'cid');
$comments_select->addExpression('0', 'notify');
// Mix in a random string to all values.
$salt = uniqid(mt_rand, TRUE);
$salt = uniqid(mt_rand(), TRUE);
if (db_driver() == 'pgsql') {
$comments_select->addExpression("md5('" . $salt . "' || c.mail || coalesce(u.mail, u.init) || c.uid || c.name || c.nid || c.hostname)", 'notify_hash');
$comments_select->addExpression("MD5(:salt || c.mail || COALESCE(u.mail, u.init) || c.uid || c.name || c.nid || c.hostname || c.cid)", 'notify_hash', array(':salt' => $salt));
}
else {
$comments_select->addExpression("md5(concat('" . $salt . "', c.mail, ifnull(u.mail, u.init), c.uid, c.name, c.nid, c.hostname))", 'notify_hash');
$comments_select->addExpression("MD5(CONCAT(:salt, c.mail, COALESCE(u.mail, u.init), c.uid, c.name, c.nid, c.hostname, c.cid))", 'notify_hash', array(':salt' => $salt));
}
// Set module weight low so that other modules act on the comment first.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment