mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-11-16 21:06:27 +01:00
13 lines
307 B
TypeScript
13 lines
307 B
TypeScript
import db from '../../db/mongodb';
|
|
|
|
export default db.collection('drive_files');
|
|
|
|
export function validateFileName(name: string): boolean {
|
|
return (
|
|
(name.trim().length > 0) &&
|
|
(name.length <= 200) &&
|
|
(name.indexOf('\\') === -1) &&
|
|
(name.indexOf('/') === -1) &&
|
|
(name.indexOf('..') === -1)
|
|
);
|
|
}
|