yakuza0 2.22.30-beta.7 → 2.22.30-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yakuza0",
3
- "version": "2.22.30-beta.7",
3
+ "version": "2.22.30-beta.8",
4
4
  "description": "yakuza0 with nuxt",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -4,10 +4,12 @@ import {shtml} from 'yakuza1/lib/xss';
4
4
  import yConf from 'yakuza0/config';
5
5
  import {connect, req} from 'yakuza1/lib/ws';
6
6
 
7
- const oToStr = (obj) => {
7
+ const shtmlFilter = (obj) => {
8
8
  if (obj && typeof obj !== "string") {
9
9
  try {
10
- return JSON.stringify(obj);
10
+ const str = JSON.stringify(obj);
11
+ const filter = shtml(str);
12
+ return JSON.parse(filter)
11
13
  } catch (e) {
12
14
  return obj
13
15
  }
@@ -63,7 +65,7 @@ export default async (ctx, inject) => {
63
65
  })
64
66
 
65
67
  if ($yk.security.stupid) {
66
- return shtml(oToStr(result && result.data));
68
+ return shtmlFilter(result && result.data);
67
69
  }
68
70
 
69
71
  return result && result.data
@@ -120,7 +122,7 @@ export default async (ctx, inject) => {
120
122
  })
121
123
 
122
124
  if ($yk.security.stupid) {
123
- return shtml(oToStr(data));
125
+ return shtmlFilter(data);
124
126
  }
125
127
 
126
128
  return data;