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