CMSB v4.0.0 Beta (Security Updates & Hardening, Major Rewrite, PHP 8.6 Support)

3 posts by 3 authors in: Forums > CMS Builder
Last Post: Yesterday at 2:09pm   (RSS)

Wow that's a big update, nice work! Suspect I'll have a few breakages to deal with when testing it later.

I had Claude Code install the Beta on a couple of development sites so all of my integrations can be accounted for. Claude reported some bugs found:

# CMS Builder 4.0.0 beta1 (build 3148): bugs found by Sagentic

Found while testing on cmsbuild.dev and sagentic.dev (PHP 8.3.37, MariaDB 10.11, `open_basedir` on, DirectAdmin).
Each entry has what to report to interactivetools.com and our workaround, if any.

## 1. Developer Log page prints an open_basedir warning for logged files outside the site

- **Where:** `lib/menus/_error_log/actionHandler.php` lines 242 and 315: `realpath($record['filepath'])`.
- **Steps:** a Developer Log record whose `filepath` is outside `open_basedir` (ours: a server-side worker at
  `/usr/local/lib/...` that loads the site's CMS library from the command line). Open Admin → Developer Log.
- **Result:** `Warning: realpath(): open_basedir restriction in effect. File(/usr/local/lib/...) is not within the allowed path(s)` printed at the top of the list.
- **Expected:** no warning; fall back to the stored path (the `?: $record['filepath']` fallback is already there, the warning just isn't suppressed).
- **Suggested fix:** `@realpath(...)`, or check the path against `open_basedir` first.
- **Our workaround:** none needed; cosmetic.

## 2. `$GLOBALS['PLUGIN_ACTION_MENU_LINKS']` removed without an UPGRADING note

- **Where:** `lib/plugin_functions.php` `pluginAction_addLink()` (~line 543). 3.84 collected Plugins-menu links in
  `$GLOBALS['PLUGIN_ACTION_MENU_LINKS']`; 4.0 prints them through `Plugin::on('plugin_actions', ...)` and the markup
  changed to `<a href='?...' data-method='post'>`.
- **Result:** a plugin that lists other plugins' action links (ours: a plugin manager dashboard) silently shows none.
- **Expected:** a line in UPGRADING.md's "Custom code that calls internal CMS functions", or keep the global.
- **Our workaround:** capture `Plugin::action('plugin_actions', $pluginPath)` output (works on 3.84 and 4.0).

## Notes (not bugs)

- A non-browser request that hits the link-check page gets 403 "Forbidden: this link only opens from the page a
  browser shows here" (curl, ajax without the token). By design; worth a sentence in UPGRADING for ajax authors.

## 3. Empty string in an encrypted column logs "cannot decrypt" (new in 4.0)

- **Where:** ZenDB 1.2.1 `src/Connection.php` ~1179: only `null` is skipped before decrypting.
- **Steps:** a record whose encrypted (MEDIUMBLOB) field holds `''` (written by raw SQL, an import, or older code).
  Load any page that reads the record.
- **Result:** Developer Log: `Warning: ZenDB: cannot decrypt MEDIUMBLOB column `acronym`, returning raw bytes. Wrong
  encryptionKey, or the column holds unencrypted data.` 3.84 was silent.
- **Expected:** treat `''` like `null` (empty), as the check for null already does. The message also points the
  admin at a wrong encryption key, which sends them looking in the wrong place.
- **Our workaround:** set such cells to NULL (sagentic.dev cms_domains #566, 14 cells, 2026-12-01).
Thanks,

Kenny H