Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The includes/database.(mysql)|(mysqli)|(pgsql) files all report sql errors in a similar fashion e.g.
if (!mysql_errno($active_db)) {
return $result;
}
else {
trigger_error(check_plain(mysql_error($active_db) ."\nquery: ". $query), E_USER_WARNING);
return FALSE;
}
But the error_handler function uses the t() function on the message
So sql errors are always double escaped, this makes them much harder to read and prevents copy-pasting the query - for running directly.
I think that check_plain should not be called in this place - removing this function call works OK for me.
Comment | File | Size | Author |
---|---|---|---|
#2 | 325978-sql-errors-encoded-twice-d6.patch | 2.15 KB | Damien Tournoud |
#2 | 325978-sql-errors-encoded-twice-d5.patch | 1.97 KB | Damien Tournoud |
Comments
Comment #1
Damien Tournoud CreditAttribution: Damien Tournoud commentedBumping to D6, because this issue does not exist in the new database layer of D7.
Comment #2
Damien Tournoud CreditAttribution: Damien Tournoud commentedTwo small patches (for D6 and D5).
Comment #3
dpearcefl CreditAttribution: dpearcefl commentedIs this still an issue using current Drupal 6?