Skip to content

Fix/upload blocked extensions filter#95

Open
hylkest wants to merge 426 commits intosplittingred:developfrom
Sterc:fix/upload-blocked-extensions-filter
Open

Fix/upload blocked extensions filter#95
hylkest wants to merge 426 commits intosplittingred:developfrom
Sterc:fix/upload-blocked-extensions-filter

Conversation

@hylkest
Copy link

@hylkest hylkest commented Mar 23, 2026

Note

Medium Risk
Touches install/upgrade packaging (resolvers, system settings, permissions, table migrations) and adds new manager-side CMP assets, so regressions could affect upgrades or manager access. Changes are mostly additive but include database schema migration logic and installer-side network call resolver.

Overview
Updates FormIt’s build/package definition to a config.json-driven workflow, including new resolvers for table creation/upgrade, permission setup, setup options, cronjob guidance, and Sterc’s extras telemetry call; the transport build now also packages assets and registers a CMP menu.

Adds a manager CMP with new assets/components/formit JS/CSS, connector, and controllers for viewing/cleaning/exporting stored forms and managing encryption operations, plus a CLI-only cron script to trigger form cleanup.

Modernizes snippet loading to use getService/loadClass, adds the FormItLoadSavedForm prehook snippet, and tweaks FormItIsChecked/FormItIsSelected to support comma-separated multi-values in addition to JSON. Also expands locale data (new country/state lists), updates docs/changelog, and adds GitHub issue/PR templates and .gitignore entries.

Written by Cursor Bugbot for commit 140e5d5. This will update automatically on new commits. Configure here.

joeke and others added 30 commits March 24, 2017 11:26
Add option to FormItCountryOptions snippet to limit country list to selected countries only
ilyautkin and others added 29 commits November 30, 2021 07:51
Changes how hasSubmission() is evaluated to allow alternate buttons to submit the form (relevant in multi-step/page forms)
Fix PHP warning: Undefined variable $operator in ERROR log. Because $operator variable is not defined in else statement.
For MODX3 compatiblity
Addresses issue  #263
MODX3: Change modRest to http client in StopForumSpam service
If the option emailSelectToName is not set, the option emailSelectTo is used. emailSelectTo was exploded before it was assigned to emailSelectToName. After that it is exploded again which causes the following issue in PHP 8. The patch just reorders the assignment.

```
PHP Fatal error:  Uncaught TypeError: explode(): Argument #2 ($string) must be of type string, array given in /…/core/components/formit/src/FormIt/Hook/Email.php:99
```
Fix error SELECT list is not in GROUP BY clause
Fix PHP warning: Undefined array key
Fix Argument 2 must be of type string
Add ID of the form to the export csv file
Fix for multiple checked boxes/multiselect on FormItLoadSavedForm
fix(math hook): undefined variable $operator error
Fix issue 271 for loading chunks via PDO
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

$output = ' checked="checked"';
}
$input = $modx->fromJSON($input);
$input = strpos($input, '"') ? $modx->fromJSON($input) : explode(',', $input);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strpos falsy-zero bug breaks JSON detection for checked/selected

Medium Severity

strpos($input, '"') returns 0 (falsy) when " is at position 0 of the string, causing the code to incorrectly use explode instead of $modx->fromJSON(). The correct check is strpos($input, '"') !== false. This classic PHP pitfall affects both snippet.formitischecked.php and snippet.formitisselected.php identically, and can cause checkbox/radio/select states to not be properly restored when the stored value starts with a double-quote character.

Additional Locations (1)
Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.