mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-05 19:41:55 +02:00
Clean JSON output of user-controlled strings
JSON has some strict rules about what can be escaped, and we should have been scrubbing to entities all along.
This commit is contained in:
parent
a7b336e326
commit
e8f4577d9a
2 changed files with 5 additions and 1 deletions
|
@ -4,6 +4,8 @@
|
|||
|
||||
--------------------------------------------------------------------------
|
||||
v.3.6-Alpha2
|
||||
- Fixed JSON escaping issue that broke search in some cases
|
||||
(reported by XeeNiX)
|
||||
- Added admin_enable_required option to user registration
|
||||
- Fixed session issue preventing some users from streaming
|
||||
(reported by miir01)
|
||||
|
|
|
@ -29,7 +29,9 @@ function arrayToJSON($array) {
|
|||
$json .= arrayToJSON($value);
|
||||
}
|
||||
else {
|
||||
$json .= '"' . $value . '"';
|
||||
// Make sure to strip backslashes and convert things to
|
||||
// entities in our output
|
||||
$json .= '"' . scrub_out(str_replace('\\', '', $value)) . '"';
|
||||
}
|
||||
$json .= ' , ';
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue