• exec/webfileindex.ssjs

    From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Sun Sep 20 03:31:33 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/12504437d6e893524b5f72be
    Modified Files:
    exec/webfileindex.ssjs
    Log Message:
    webfileindex: serve archive listings from the content store

    view_archive() re-enumerated the archive on every request. It now reads the per-area content store, extracting and storing only on a miss, so a crawl of the file base pays for each archive once rather than once per view.

    Archive entry names are now HTML-encoded. Those names come from inside the archive, where ILLEGAL_FILENAME_CHARS does not constrain them, so an entry named with markup was written into the page as-is. File-base names elsewhere
    on the page are unaffected, since < > and " are illegal in those.

    'arc' joins the viewable-archive list. libarchive cannot read the format at all, so the web reported "Non-viewable file type" for every one of them and never reached the extraction path; the store's external-tool fallback lists them.

    #1247

    Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Mon Sep 21 22:21:21 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/cc328fcea5c7d4b48e7ccb6a
    Modified Files:
    exec/webfileindex.ssjs
    Log Message:
    webfileindex: encode archive entry names as text rather than as ANSI

    An entry name came from inside the archive and went through
    html_encode() with the ANSI and Ctrl-A conversions left enabled, so
    every listing row was wrapped in a hard-coded inline color span (black background, overriding the dark-mode style sheet), and an ESC or Ctrl-A
    in a name was rendered as markup rather than escaped.

    Extended ASCII was converted to numeric character references, which is
    correct for the CP437 names in a DOS-era archive but mangles a name a
    modern tool wrote in UTF-8: every byte of the sequence became a separate
    CP437 entity.

    Encode with only the HTML escaping enabled, then convert CP437 to UTF-8
    the way this script already does for file descriptions, skipping the
    conversion when the name is valid UTF-8 already. That is the test
    newsutil.js applies to a message body.

    Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
    --- SBBSecho 3.37-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
  • From Rob Swindell (on Debian Linux)@1:103/705 to Git commit to main/sbbs/master on Thu Nov 19 09:20:50 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/87101559123c80dfa9c3e542
    Modified Files:
    exec/webfileindex.ssjs
    Log Message:
    webfileindex.ssjs: escape file descriptions in the listing

    A file's description and extended description were written into the
    directory listing page as they are stored. Both are text the uploader
    types, so markup in one was rendered by the browser of anyone viewing
    that listing. They now go through html_encode() first, as the archive
    contents on the view page already do. File names were not affected:
    the characters that matter are not allowed in them.

    Part of #1363; the download headers described there are a separate
    change in the web server.

    Checked: the escaping on sample text under jsexec (markup shown as
    text, CP437 line drawing and the extended description's line breaks
    kept), and a live directory listing viewed by the sysop.

    Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
    --- SBBSecho 3.38-Linux
    * Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)