• webv4/lib/pages.js

    From Rob Swindell@VERT to Git commit to main/sbbs/master on Sat Jan 23 15:51:06 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/34cf114ab3a3f841e9296f07
    Modified Files:
    webv4/lib/pages.js
    Log Message:
    Eliminate "_file is undefined" error.

    Not sure the cause, but this change stops the error-machine:

    Jan 23 15:03:43 cvs sbbs: web 0120 Request: GET /?page=001-forum.ssjs+AND+1+%3D+1&sub=mystic+AND+1+%3D+1&thread=4809+AND+1+%3D+1 HTTP/1.1
    Jan 23 15:03:43 cvs sbbs: web 0120 HTTP Logon (user #0)
    Jan 23 15:03:43 cvs sbbs: web 0120 Internal Redirect to: GET /index.xjs HTTP/1.1
    Jan 23 15:03:43 cvs sbbs: web 0120 Handling Internal Redirect to: GET /index.xjs HTTP/1.1
    Jan 23 15:03:43 cvs sbbs: web 0120 Adding query value page=001-forum.ssjs AND 1 = 1 at pos 0
    Jan 23 15:03:43 cvs sbbs: web 0120 Adding query value sub=mystic AND 1 = 1 at pos 0
    Jan 23 15:03:43 cvs sbbs: web 0120 Adding query value thread=4809 AND 1 = 1 at pos 0
    Jan 23 15:03:43 cvs sbbs: web 0120 JavaScript: Compiling script: /sbbs/exec/xjs_handler.js
    Jan 23 15:03:43 cvs sbbs: web 0120 JavaScript: Executing script: /sbbs/exec/xjs_handler.js
    Jan 23 15:03:43 cvs sbbs: web 0120 HTTP Logon (user #4)
    Jan 23 15:03:43 cvs sbbs: web 0120 !JavaScript /share/sbbs/webv4/lib/pages.js line 42: TypeError: _file is undefined, Request: /index.xjs

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From echicken@VERT to Git commit to main/sbbs/master on Thu Jan 28 19:33:17 2021
    https://gitlab.synchro.net/main/sbbs/-/commit/64c382e35c6ea113591fbbf7
    Modified Files:
    webv4/lib/pages.js
    Log Message:
    Trim whitespace from page control line

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net
  • From Rob Swindell (on Windows 11)@VERT to Git commit to main/sbbs/master on Mon Jul 27 02:10:11 2026
    https://gitlab.synchro.net/main/sbbs/-/commit/0d40b6dee4a74050c05d43ed
    Modified Files:
    webv4/lib/pages.js
    Log Message:
    webv4: don't let a wildcard or directory page name throw

    A request for /index.xjs?page=* logged:

    !JavaScript lib/pages.js line 48: TypeError: file_getext(file) is
    undefined

    getPagePath() gates on file_exists(), which is fexist() -- and a
    filespec containing a wildcard is globbed rather than tested as a
    literal name, so "pages\*" matches the first file in the directory and
    the wildcard path is handed back as though it were a page. It then
    passes the "must live under web_pages" prefix check, and file_getext()
    returns undefined for it (no extension), so .toUpperCase() throws.

    file_exists() on a directory is false on Windows but true on Unix (glob
    matches directories), so ?page=<subdirectory-of-pages> -- e.g. the
    stock "More" folder -- reaches the same throw on a Unix host.

    Reject page names containing wildcard characters, require a regular
    file rather than merely an existing path, and treat an absent extension
    as "" at the three file_getext().toUpperCase() sites. An unusable page
    name now falls back to the home page as any other bad one does.

    Wildcard globbing in getPagePath() dates to fbaf71eac5e (2020-09-23);
    the unguarded file_getext() in getCtrlLine() to 6369a1472aa
    (2019-03-14).

    Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

    ---
    ■ Synchronet ■ Vertrauen ■ Home of Synchronet ■ [vert/cvs/bbs].synchro.net