Skip to content

Commit

Permalink
Fix a few more missed &s
Browse files Browse the repository at this point in the history
  • Loading branch information
mia-pi-git committed Oct 1, 2024
1 parent 8c290a4 commit 747326f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions server/chat-plugins/responder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,11 @@ export class AutoResponder {
}
if (str.length > 300 && !raw) throw new Chat.ErrorMessage("Your given string is too long.");
return args.map(item => {
const split = item.split('~').map(string => {
const split = item.split('&').map(string => {
// allow raw regex for admins and users with @ in Dev
if (raw) return string;
// escape
return string.replace(/[\\^$.*+?()[\]{}]/g, '\\$~').trim();
return string.replace(/[\\^$.*+?()[\]{}]/g, '\\$&').trim();
});
return split.map(term => {
if (term.length > 100 && !raw) {
Expand Down
2 changes: 1 addition & 1 deletion server/chat-plugins/smogtours.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ export const pages: Chat.PageTable = {
.replace(/"/g, '"')
.replace(/>/g, '>')
.replace(/&lt;/g, '<')
.replace(/&amp;/g, '~');
.replace(/&amp;/g, '&');
// stuff!
let buf = `${back(categoryID)}${refresh(this.pageid)}<br />`;
buf += `<center><h2><a href="${tour.url}">${tour.title}</a></h2>`;
Expand Down
2 changes: 1 addition & 1 deletion server/chat-plugins/thing-of-the-day.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function savePrenoms() {
}

function toNominationId(nomination: string) {
return nomination.toLowerCase().replace(/\s/g, '').replace(/\b~\b/g, '');
return nomination.toLowerCase().replace(/\s/g, '').replace(/\b&\b/g, '');
}

class OtdHandler {
Expand Down
2 changes: 1 addition & 1 deletion server/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1604,7 +1604,7 @@ export const Chat = new class {
// \uF900-\uFAFF\uFE00-\uFE6F CJK extended
name = name.replace(
// eslint-disable-next-line no-misleading-character-class
/[^a-zA-Z0-9 /\\.~()<>^*%~=+$#_'?!"\u00A1-\u00BF\u00D7\u00F7\u02B9-\u0362\u2012-\u2027\u2030-\u205E\u2050-\u205F\u2190-\u23FA\u2500-\u2BD1\u2E80-\u32FF\u3400-\u9FFF\uF900-\uFAFF\uFE00-\uFE6F-]+/g,
/[^a-zA-Z0-9 /\\.~()<>^*%&=+$#_'?!"\u00A1-\u00BF\u00D7\u00F7\u02B9-\u0362\u2012-\u2027\u2030-\u205E\u2050-\u205F\u2190-\u23FA\u2500-\u2BD1\u2E80-\u32FF\u3400-\u9FFF\uF900-\uFAFF\uFE00-\uFE6F-]+/g,
''
);

Expand Down

0 comments on commit 747326f

Please sign in to comment.