Skip to content

Commit 01aab62

Browse files
authored
Merge pull request #12 from MoritzHuppert/master
prevention of xss in messages
2 parents 7a107ec + e9d13be commit 01aab62

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

box/core/kchat.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ function msgencode($txt){
184184
}
185185

186186
function msgdecode($txt){
187-
return json_decode('"'.$txt.'"', 1);
187+
return htmlspecialchars(json_decode('"'.$txt.'"', 1));
188188
}
189189

190190
function isReq($id){

kchat/lib/global.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ function msgencode($data,$txt){
217217
}
218218

219219
function msgdecode($data,$txt){
220-
return json_decode('"'.$txt.'"', 1);
220+
return htmlspecialchars(json_decode('"'.$txt.'"', 1));
221221
}
222222

223223
function menu($data,$key,$value){

0 commit comments

Comments
 (0)