Skip to content

Commit

Permalink
Merge branch 'release/1.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
petschekr committed Apr 6, 2017
2 parents 85aacfb + e3b11a2 commit ce35ac2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
8 changes: 4 additions & 4 deletions client/js/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function delay (milliseconds: number) {

function statusFormatter (time: Date, by: string = "unknown"): string {
// Escape possible HTML in username
by = by.replace("&", "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
by = by.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");

return `Checked in <abbr title="${moment(time).format("dddd, MMMM Do YYYY, h:mm:ss A")}">${moment(time).fromNow()}</abbr> by <code>${by}</code>`;
}
Expand Down Expand Up @@ -169,7 +169,7 @@ function loadAttendees (filter: string = queryField.value, checkedIn: string = c
attendeeList.querySelector(`#item-${attendee.id} > .actions > button`)!.addEventListener("click", checkIn);
}
tag = tag || "no tags found";
tag = tag.replace("&", "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
tag = tag.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
status.innerHTML = `Found ${response.length} attendee${response.length === 1 ? "" : "s"} (<code>${tag}</code>)`;
(<any> window).mdc.autoInit();
}).catch((e, xhr, response) => {
Expand Down Expand Up @@ -287,7 +287,7 @@ document.getElementById("add-update-user")!.addEventListener("click", (e) => {
}
[usernameInput, passwordInput].forEach(el => {
el.value = "";
el.nextElementSibling.classList.remove("mdc-textfield__label--float-above");
el.nextElementSibling!.classList.remove("mdc-textfield__label--float-above");
});

}).catch((e, xhr, response) => {
Expand Down Expand Up @@ -360,4 +360,4 @@ setInterval(() => {
if (currentState === State.CheckIn) {
loadAttendees();
}
}, 1000 * 60);
}, 1000 * 60);
21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "check-in",
"version": "1.1.0",
"version": "1.1.1",
"description": "Check in for HackGT events",
"main": "app.js",
"scripts": {
Expand All @@ -14,19 +14,20 @@
"url": "https://github.com/petschekr"
},
"dependencies": {
"body-parser": "^1.15.2",
"body-parser": "^1.17.1",
"cheerio": "^0.22.0",
"compression": "^1.6.2",
"cookie-parser": "^1.4.3",
"csv-parse": "^1.1.9",
"express": "^4.14.0",
"git-rev-sync": "^1.8.0",
"csv-parse": "^1.2 .0",
"escape-string-regexp": "^1.0.5",
"express": "^4.15.2",
"git-rev-sync": "^1.9.0",
"json2csv": "^3.7.3",
"material-components-web": "^0.2.0",
"mongoose": "^4.7.6",
"multer": "^1.2.1",
"serve-static": "^1.11.1",
"ws": "^1.1.1"
"material-components-web": "^0.8.0",
"mongoose": "^4.9.3",
"multer": "^1.3.0",
"serve-static": "^1.12.1",
"ws": "^2.2.3 "
},
"devDependencies": {
"@types/body-parser": "0.0.33",
Expand Down
8 changes: 5 additions & 3 deletions server/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import * as compression from "compression";
import * as bodyParser from "body-parser";
import * as cookieParser from "cookie-parser";
import * as multer from "multer";
import * as reEscape from "escape-string-regexp";

let postParser = bodyParser.urlencoded({
extended: false
});
Expand Down Expand Up @@ -327,11 +329,11 @@ apiRouter.route("/data/import").post(authenticateWithReject, uploadHandler.singl
for (let i = 0; i < record.length; i++) {
let label: string = record[i];

if (label.match(new RegExp(`^${nameHeader}$`, "i"))) {
if (label.match(new RegExp(`^${reEscape(nameHeader)}$`, "i"))) {
nameIndex = i;
}
for (let emailHeader of emailHeaders) {
if (label.match(new RegExp(`^${emailHeader}$`, "i"))) {
if (label.match(new RegExp(`^${reEscape(emailHeader)}$`, "i"))) {
emailIndexes.push(i);
}
}
Expand Down Expand Up @@ -624,4 +626,4 @@ wss.on("connection", function(rawSocket) {
});
server.listen(PORT, () => {
console.log(`Check in system v${VERSION_NUMBER} @ ${VERSION_HASH} started on port ${PORT}`);
});
});

0 comments on commit ce35ac2

Please sign in to comment.