Bug #656
JSON API PROBLEM (VERSION 0.4.0)
| Status: | Rejected | Start: | 12/26/2011 | |
|---|---|---|---|---|
| Priority: | Low | Due date: | ||
| Assigned to: | - | % Done: | 100% |
|
| Category: | websearch | Spent time: | - | |
| Target version: | - |
Description
We would like to receive information from the server http://91.223.180.220:81/search/txt/?q=paris&output=json
data come in JSON. We handle them in PHP json_decode ().
If the data come such as [Variant 1] - everything is handled properly.
[ Variant 1 ]
---------------
{
"query": "paris",
"lang": "en",
"pers": "on",
"snippets": [{
"id": 2373693552,
"title": "Paris. Website of town Paris.",
"url": "http://www.alushta.crimea.ua/",
"summary": "Wild and recreation. Excursions.",
"cite": "http://www.paris.com/",
"type": "webpage",
}
}
If the data comes as [ Variant 2 ] - error occurs in the function json_decode (). The error occurs because of the quotes in the line "summary"
[ Variant 2 ]
---------------
{
"query": "paris",
"lang": "en",
"pers": "on",
"snippets": [{
"id": 2373693552,
"title": "Paris. Website of town Paris.",
"url": "http://www.alushta.crimea.ua/",
"summary": "Wild and recreation. Excursions. The boarding house "Paris hotel"",
"cite": "http://www.paris.com/",
"type": "webpage",
}
}
Apparently the server serves data not shielded (ie, before quotation marks should be a backslash like this : \” )
History
Updated by Emmanuel Benazera 5 months ago
- Category set to websearch
- Status changed from New to In Progress
- Assigned to set to Igor Goncharuk
- Priority changed from Immediate to Low
- % Done changed from 0 to 100
I can't reproduce. I've tried with quoted strings injected into the summary, and the JSON is correctly escaped.
I've double checked, and the JSON output passes jsonlint testing.
I've no doubt you're experiencing a problem, but unless you can provide more information, and a way to reproduce the problem on a standard seeks instance, this ticket will be rejected.
Updated by Emmanuel Benazera 4 months ago
- Status changed from In Progress to Rejected
- Assigned to deleted (
Igor Goncharuk)