mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 03:57:21 +00:00
Allow attachment handling to be switched off
This commit is contained in:
parent
b4664bd7d1
commit
066771e6e9
@ -0,0 +1,2 @@
|
||||
title: $:/config/MultiWikiServer/EnableAttachments
|
||||
text: no
|
@ -148,9 +148,10 @@ SqlTiddlerStore.prototype.processIncomingTiddler = function(tiddlerFields) {
|
||||
if(attachmentSizeLimit < 100 * 1024) {
|
||||
attachmentSizeLimit = 100 * 1024;
|
||||
}
|
||||
const attachmentsEnabled = this.adminWiki.getTiddlerText("$:/config/MultiWikiServer/EnableAttachments","yes") === "yes";
|
||||
const contentTypeInfo = $tw.config.contentTypeInfo[tiddlerFields.type || "text/vnd.tiddlywiki"],
|
||||
isBinary = !!contentTypeInfo && contentTypeInfo.encoding === "base64";
|
||||
if(isBinary && tiddlerFields.text && tiddlerFields.text.length > attachmentSizeLimit) {
|
||||
if(attachmentsEnabled && isBinary && tiddlerFields.text && tiddlerFields.text.length > attachmentSizeLimit) {
|
||||
const attachment_blob = this.attachmentStore.saveAttachment({
|
||||
text: tiddlerFields.text,
|
||||
type: tiddlerFields.type,
|
||||
|
Loading…
Reference in New Issue
Block a user