Closed (fixed)
Project:
Drush
Version:
6.x-1.0
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Sep 2008 at 05:25 UTC
Updated:
29 Nov 2008 at 04:41 UTC
The 'watchdog show' command shows raw messages, variables need to be merged with the message before display.
Example output:
Date Severity Type Message User
---- -------- ---- ------- ----
09/06/2008 - 01:14 error php %message in %file on line %line. Anonymous
Comments
Comment #1
mariuss commentedJust a side note, this issue is similar to one from another module: #303369: log message in email without variables
I guess both can be fixed the exact same way.
Comment #2
mariuss commentedWhile creating a patch I realized that this issue is most likely fixed in the latest dev version. Will retest when the next version comes out.
Comment #3
mariuss commentedOn a second thought, the way it was implemented has a problem. Since _dblog_format_message is used the t function is applied. To get rid of HTML tags (mostly em tags I guess), strip_tags is used. But this still leaves there encoded HTML entities.
If you have single quotes in your variables, and that's quite common with SQL statements for example, then they will show up pretty ugly.
One solution would be to use straight strtr, instead of _dblog_format_message/t + strip_tags. The only issue with strtr is that localization now is skipped. Not sure if localization is an issue in this case, it could be.
The proper solution would be to write a method similar to t, which is not calling either check_plain nor theme_placeholder, basically treats every variable as starting with '!'. Ideally such a function would live in Drupal core, or it could be implemented as an extra argument to t.
Comment #4
moshe weitzman commentedcommitted the suggested solution.