GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: XSS in Helper.alert, thx to @tomaioo #83 · TommyLemon/APIAuto@ada1416

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • js
    • helper.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎js/helper.js‎

Copy file name to clipboard
+11-8Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
window.Helper = {
22
// 提示
3-
alert: function (msg, typ) {
4-
var alertDiv = $('<div class="alert"><div class="alert-inner alert-' + typ + '">' + msg + '</div></div>')
5-
$('body').append(alertDiv)
6-
alertDiv.animate({top: 8})
7-
setTimeout(function () {
8-
alertDiv.remove()
9-
}, 2000)
10-
}
3+
alert: function (msg, typ) {
4+
var validTypes = { 'success': 1, 'info': 1, 'warning': 1, 'danger': 1, 'error': 1 }
5+
var safeTyp = validTypes[typ] ? typ : 'info'
6+
var alertDiv = $('<div class="alert"><div class="alert-inner alert-' + safeTyp + '"></div></div>')
7+
alertDiv.find('.alert-inner').text(msg)
8+
$('body').append(alertDiv)
9+
alertDiv.animate({top: 8})
10+
setTimeout(function () {
11+
alertDiv.remove()
12+
}, 2000)
13+
}
1114
}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.