Fix to an invalid json request detection leading to the JSON export failing

- It seems like relying on the Accept header can lead to the data type detection failing when accessing .json extension views
- this issue seems to have gone unnoticed since until now the data passed to the json view was the same as that passed to the html view
- this means that all the additional UI only features may have triggered in the background previously on .json views
pull/762/head
iglocska 2015-11-15 17:43:19 +01:00
parent f36e00e944
commit 487912a15a
1 changed files with 1 additions and 1 deletions

View File

@ -236,7 +236,7 @@ class AppController extends Controller {
protected function _isJson($data=false){
if ($data) return (json_decode($data) != NULL) ? true : false;
return $this->request->header('Accept') === 'application/json';
return $this->request->header('Accept') === 'application/json' || $this->RequestHandler->prefers() === 'json';
}
//public function blackhole($type) {