mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-08-03 08:22:02 +02:00
* Added ability to serve static files from web server
* Web server can have custom error pages, e.g. 404.html * "file_area" stuff -> "file_base" * Fix some rare bugs in theme/art loading * Adjust tab order dynamically for file upload details
This commit is contained in:
parent
ff64a7aed5
commit
92772eb1a9
14 changed files with 165 additions and 48 deletions
10
core/art.js
10
core/art.js
|
@ -78,7 +78,7 @@ function getArtFromPath(path, options, cb) {
|
|||
return iconv.decode(data, encoding);
|
||||
} else {
|
||||
const eofMarker = defaultEofFromExtension(ext);
|
||||
return iconv.decode(sliceAtEOF(data, eofMarker), encoding);
|
||||
return iconv.decode(eofMarker ? sliceAtEOF(data, eofMarker) : data, encoding);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -213,11 +213,15 @@ function getArt(name, options, cb) {
|
|||
}
|
||||
|
||||
function defaultEncodingFromExtension(ext) {
|
||||
return SUPPORTED_ART_TYPES[ext.toLowerCase()].defaultEncoding;
|
||||
const artType = SUPPORTED_ART_TYPES[ext.toLowerCase()];
|
||||
return artType ? artType.defaultEncoding : 'utf8';
|
||||
}
|
||||
|
||||
function defaultEofFromExtension(ext) {
|
||||
return SUPPORTED_ART_TYPES[ext.toLowerCase()].eof;
|
||||
const artType = SUPPORTED_ART_TYPES[ext.toLowerCase()];
|
||||
if(artType) {
|
||||
return artType.eof;
|
||||
}
|
||||
}
|
||||
|
||||
// :TODO: Implement the following
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue