Encode html entities in log
This commit is contained in:
@@ -78,15 +78,16 @@ Page.Log = new Class({
|
||||
addColors: function(text){
|
||||
var self = this;
|
||||
|
||||
var text = new Element('div', {
|
||||
'html': text
|
||||
}).get('text')
|
||||
|
||||
text = text.replace(/\u001b\[31m/gi, '</span><span class="error">')
|
||||
text = text.replace(/\u001b\[36m/gi, '</span><span class="debug">')
|
||||
text = text.replace(/\u001b\[33m/gi, '</span><span class="debug">')
|
||||
text = text.replace(/\u001b\[0m\n/gi, '</span><span class="time">')
|
||||
text = text.replace(/\u001b\[0m/gi, '</span><span>')
|
||||
text = text
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"')
|
||||
.replace(/\u001b\[31m/gi, '</span><span class="error">')
|
||||
.replace(/\u001b\[36m/gi, '</span><span class="debug">')
|
||||
.replace(/\u001b\[33m/gi, '</span><span class="debug">')
|
||||
.replace(/\u001b\[0m\n/gi, '</span><span class="time">')
|
||||
.replace(/\u001b\[0m/gi, '</span><span>')
|
||||
|
||||
return '<span class="time">' + text + '</span>';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user