Skip to content

Escape dynamic SQL inputs in WizardService#17

Merged
NB-Core merged 1 commit into
tlwizardfrom
codex/escape-dynamic-values-in-translation-methods
Jul 13, 2025
Merged

Escape dynamic SQL inputs in WizardService#17
NB-Core merged 1 commit into
tlwizardfrom
codex/escape-dynamic-values-in-translation-methods

Conversation

@NB-Core
Copy link
Copy Markdown
Owner

@NB-Core NB-Core commented Jul 13, 2025

Summary

  • add addslashes() escaping before SQL interpolation in createTranslation()
  • apply same escaping in deleteUntranslated()
  • escape update query parameters in saveBatchTranslations()
  • add inline notes explaining why manual escaping is used

Testing

  • git status --short

https://chatgpt.com/codex/tasks/task_e_6873e4c0f9c0832989c0e07fce9a9f7a

@NB-Core NB-Core requested a review from Copilot July 13, 2025 17:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds manual escaping for dynamic SQL inputs in WizardService due to the lack of parameterized query support.

  • Escape input values with addslashes() in createTranslation(), deleteUntranslated(), and saveBatchTranslations()
  • Add inline comments explaining why manual escaping is used
Comments suppressed due to low confidence (1)

systems/translationwizard/translationwizard/WizardService.php:12

  • There are no tests covering edge cases for SQL inputs containing quotes or special characters. Adding test cases for createTranslation, deleteUntranslated, and saveBatchTranslations would help ensure the escaping logic works as intended.
    public static function createTranslation(string $language, string $namespace, string $intext, string $outtext, string $author, string $version) {

Comment thread systems/translationwizard/translationwizard/WizardService.php
Comment thread systems/translationwizard/translationwizard/WizardService.php
@NB-Core NB-Core merged commit 66bc33e into tlwizard Jul 13, 2025
@NB-Core NB-Core deleted the codex/escape-dynamic-values-in-translation-methods branch July 13, 2025 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants