Skip to content

Commit

Permalink
fix(backend): SQLのサニタイズを強化 (#14920)
Browse files Browse the repository at this point in the history
* Fix code scanning alert no. 28: Incomplete string escaping or encoding (MisskeyIO#800)

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
(cherry picked from commit 443335c)

* ✌️

---------

Co-authored-by: あわわわとーにゅ <[email protected]>
  • Loading branch information
kakkokari-gtyih and u1-liquid authored Nov 9, 2024
1 parent 8a4ce16 commit 98b4717
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/backend/src/misc/sql-like-escape.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
*/

export function sqlLikeEscape(s: string) {
return s.replace(/([%_])/g, '\\$1');
return s.replace(/([\\%_])/g, '\\$1');
}

0 comments on commit 98b4717

Please sign in to comment.