Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Commit

Permalink
Merge pull request #13 from NfoAlex/SendFilesWithoutTxt
Browse files Browse the repository at this point in the history
Send files without txt
  • Loading branch information
NfoAlex authored Jun 7, 2023
2 parents 7f96bbd + 6897abc commit 246be20
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ let msgMix = function msgMix(m) {
//メッセージがそもそも有効なものかどうか
if (
m.content === undefined ||
m.content.length >= 250 || //長さが250文字以上だったら
m.content.length == 0 || //長さが0だったら
(m.content.includes("<img") && m.content.includes("onerror")) || //XSS避け
m.content.replace(/ /g,"").length === 0 || //空白だけのメッセージだった時用
m.content.replace(/ /g,"").length === 0 //半角も同様
m.content.length > 250 || //長さが250文字を超えてるなら
( m.content.includes("<img") && m.content.includes("onerror") ) || //XSS避け
( m.content.length === 0 && !m.fileData.isAttatched ) || //長さが0だったら
( m.content.replace(/ /g,"").length === 0 && !m.fileData.isAttatched ) || //添付ファイルがなく、空白だけのメッセージだった時用
( m.content.replace(/ /g,"").length === 0 && !m.fileData.isAttatched ) //添付ファイルがなく、半角も同様
) {
return -1; //エラーとして返す

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const e = require("express");

const port = process.env.PORT || 33333;

const SERVER_VERSION = "alpha_20230606";
const SERVER_VERSION = "alpha_20230607";

const app = express();
const server = http.createServer(app);
Expand Down

0 comments on commit 246be20

Please sign in to comment.