You do not say if you are using 1.9 or 2.0
There is some code (or something) here: http://tracker.moodle.org/browse/MDL-20290
And there is this tracker item as well: http://tracker.moodle.org/browse/MDL-20647
This wil be a minor fix. Why not try t get it done properly (followng the coding guidelines) and get it into the core?