Refactor wizard helpers#14
Conversation
There was a problem hiding this comment.
Pull Request Overview
Refactors translation wizard helpers by centralizing save and copy operations in WizardService, updating entry points to use these helpers, and removing now-obsolete standalone scripts.
- Removes individual scripts (
save_single.php,randomsave.php,multichecked.php,copychecked.php) in favor of service methods. - Adds
copyCheckedTranslationsandsaveBatchTranslationstoWizardService. - Updates
list.phpandtranslationwizard.phpto call new service methods and inline the random-save flow.
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
Comments suppressed due to low confidence (1)
systems/translationwizard/translationwizard/list.php:33
- The call to
WizardService::ensureArraywill fail ifensureArrayis not defined inWizardService. Please implementensureArrayor replace it with a function that safely handles scalar vs. array inputs.
WizardService::ensureArray($transintext),
| } else { | ||
| require("./modules/translationwizard/$op.php"); |
There was a problem hiding this comment.
Legacy operations like save_single, multichecked, and copychecked have been removed but will still be required here when $op matches those names. Add explicit handling or routing for those operations to avoid runtime include errors.
| } else { | |
| require("./modules/translationwizard/$op.php"); | |
| } elseif (in_array($op, ['save_single', 'multichecked', 'copychecked'])) { | |
| // Explicit handling for legacy operations | |
| require("./modules/translationwizard/legacy/$op.php"); | |
| } elseif (in_array($op, ['default', 'scanmodules', 'other_valid_op'])) { | |
| // Validate $op against a whitelist of allowed operations | |
| require("./modules/translationwizard/$op.php"); | |
| } else { | |
| // Fallback for unknown operations | |
| output("Invalid operation specified."); |
There was a problem hiding this comment.
This SQL update uses unescaped user input ($out), which can lead to SQL injection. Consider using parameterized queries or a proper escaping function instead of directly interpolating variables.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

Summary
WizardServicelist.phprandomsavehandlingTesting
php -l systems/translationwizard/translationwizard/WizardService.phpphp -l systems/translationwizard/translationwizard/list.phpphp -l systems/translationwizard/translationwizard.phphttps://chatgpt.com/codex/tasks/task_e_6873d43ae3f88329bb8484779922221f