1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-11-24 03:04:51 +00:00

Make sure all "get" access to $tw.config.fileExtensionInfo goes through a $tw.utils.getFileExtensionInfo helper function that ensures the parameter is cast to lowercase. Fixes #1418.

This commit is contained in:
Jim Lehmer
2015-02-01 12:33:40 -06:00
parent 2db6cbed2d
commit 8cd0c2afcd
3 changed files with 16 additions and 8 deletions

View File

@@ -38,7 +38,7 @@ exports["text/vnd.tiddlywiki2-recipe"] = function(text,fields) {
},
loadTiddlersFromFile = function(sourcePath,prefix) {
var ext = path.extname(sourcePath),
extensionInfo = $tw.config.fileExtensionInfo[ext],
extensionInfo = $tw.utils.getFileExtensionInfo(ext),
typeInfo = extensionInfo ? $tw.config.contentTypeInfo[extensionInfo.type] : null,
data = fs.readFileSync(sourcePath,typeInfo ? typeInfo.encoding : "utf8"),
fields = {title: sourcePath},