Skip to content

Commit

Permalink
增加题目
Browse files Browse the repository at this point in the history
  • Loading branch information
haozi committed Mar 22, 2017
1 parent dab59b9 commit 077bc89
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ module.exports = {
'no-lone-blocks': 0,
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0, // 线上禁止 debugger
'no-implicit-globals': 2, // 禁止隐式暴露全局变量
'no-alert': process.env.NODE_ENV === 'production' ? 2 : 0, // 线上禁止 alert
'no-alert': process.env.NODE_ENV === 'production' ? 2 : 0 // 线上禁止 alert
}
}
2 changes: 1 addition & 1 deletion src/Exam.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
try {
let code = `(function(){
'use strict';
var alert,prompt,confirm,location,window,top,self,parent,document,Function,execScript,setTimeout,setInterval,console,localStorage,sessionStorage;
var alert,prompt,confirm,location,window,top,self,parent,frames,open,document,Function,execScript,setTimeout,setInterval,console,localStorage,sessionStorage;
return (
${beCode.trim()}
)(\`${escapeJS(feCode)}\`)
Expand Down
File renamed without changes.
File renamed without changes.
4 changes: 1 addition & 3 deletions src/data/exam/_102.alf nu.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// from alf.nu
function escape (s) {
let text = s.replace(/</g, '&lt;').replace(/"/g, '&quot;')
// URLs
text = text.replace(/(http:\/\/\S+)/g, '<a href="$1">$1</a>')
// [[img123|Description]]
text = text.replace(/\[\[(\w+)\|(.+?)\]\]/g, '<img alt="$2" src="$1.gif">')
text = text.replace(/\[\[(\w+)\|(.+?)]]/g, '<img alt="$2" src="$1.gif">')
return text
}
12 changes: 6 additions & 6 deletions src/data/exam/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export default {
"0x0E",
"0x0F",
"0x10",
"0x64",
"0x65"
"0x11",
"0x12"
],
"data": {
"0x00": {
Expand Down Expand Up @@ -89,12 +89,12 @@ export default {
"beCode": "function render (input) {\n return `\n<script>\n window.data = ${input}\n</script>\n `\n}",
"title": "window var"
},
"0x64": {
"beCode": "// from alf.nu\nfunction escape (s) {\n s = s.replace(/\"/g, '\\\\\"')\n return '<script>console.log(\"' + s + '\");</script>'\n}",
"0x11": {
"beCode": "// from alf.nu\nfunction render (s) {\n function escapeJs (s) {\n return String(s)\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/'/g, '\\\\\\'')\n .replace(/\"/g, '\\\\\"')\n .replace(/`/g, '\\\\`')\n .replace(/</g, '\\\\74')\n .replace(/>/g, '\\\\76')\n .replace(/\\//g, '\\\\/')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/\\t/g, '\\\\t')\n .replace(/\\f/g, '\\\\f')\n .replace(/\\v/g, '\\\\v')\n // .replace(/\\b/g, '\\\\b')\n .replace(/\\0/g, '\\\\0')\n }\n s = escapeJs(s)\n return `\n<script>\n var url = 'javascript:console.log(\"${s}\")'\n var a = document.createElement('a')\n a.href = url\n document.body.appendChild(a)\n a.click()\n</script>\n`\n}",
"title": "alf nu"
},
"0x65": {
"beCode": "// from alf.nu\nfunction render (s) {\n function escapeJs (s) {\n return String(s)\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/'/g, '\\\\\\'')\n .replace(/\"/g, '\\\\\"')\n .replace(/`/g, '\\\\`')\n .replace(/</g, '\\\\74')\n .replace(/>/g, '\\\\76')\n .replace(/\\//g, '\\\\/')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/\\t/g, '\\\\t')\n .replace(/\\f/g, '\\\\f')\n .replace(/\\v/g, '\\\\v')\n // .replace(/\\b/g, '\\\\b')\n .replace(/\\0/g, '\\\\0')\n }\n s = escapeJs(s)\n return `\n<script>\n var url = 'javascript:console.log(\"${s}\")'\n var a = document.createElement('a')\n a.href = url\n document.body.appendChild(a)\n a.click()\n</script>\n`\n}",
"0x12": {
"beCode": "// from alf.nu\nfunction escape (s) {\n s = s.replace(/\"/g, '\\\\\"')\n return '<script>console.log(\"' + s + '\");</script>'\n}",
"title": "alf nu"
}
}
Expand Down

0 comments on commit 077bc89

Please sign in to comment.