回答編集履歴

2

コードの修正

2016/09/26 18:34

投稿

nnssn
nnssn

スコア1221

test CHANGED
@@ -16,11 +16,11 @@
16
16
 
17
17
  {
18
18
 
19
- $json_string = (string)$response;
19
+ $json = (string)$response;
20
20
 
21
- $json = json_decode($json_string, true);
21
+ $array = json_decode($json, true);
22
22
 
23
- $res = ")]}'," . json_encode($json[1]);
23
+ $res = ")]}'," . json_encode($array[1]);
24
24
 
25
25
  return \Response::forge($res);
26
26
 

1

不要データを除去

2016/09/26 18:34

投稿

nnssn
nnssn

スコア1221

test CHANGED
@@ -16,9 +16,13 @@
16
16
 
17
17
  {
18
18
 
19
- $res = ")]}'," . (string)$response;
19
+ $json_string = (string)$response;
20
20
 
21
+ $json = json_decode($json_string, true);
22
+
23
+ $res = ")]}'," . json_encode($json[1]);
24
+
21
- return Response::forge($res);
25
+ return \Response::forge($res);
22
26
 
23
27
  }
24
28
 
@@ -28,6 +32,6 @@
28
32
 
29
33
  再度Responseオブジェクトに詰めて返すで出来ました。
30
34
 
31
- Controller_Restのafterを無視していたり、余計なデータがくっついてたりしていますが
35
+ Controller_Restのafterを無視していますが、JSON Vulnerability Protectionを
32
36
 
33
- JSON Vulnerability Protectionを確認するため一時的になら問題ないかと。
37
+ 確認するため一時的になら問題ないかと。