This website requires JavaScript.
Explore
Help
Register
Sign in
HoovesSocial
/
hippofish
Watch
2
Star
0
Fork
You've already forked hippofish
0
Code
Issues
3
Pull requests
1
Projects
Releases
Packages
Wiki
Activity
Actions
55118df538
hippofish
/
packages
/
backend
/
src
/
misc
/
sql-like-escape.ts
4 lines
83 B
TypeScript
Raw
Normal View
History
Unescape
Escape
(partially) cherry-picked from misskey/10e526b fix: Escape SQL LIKE * SQL LIKE escape * CHANGELOG
2023-01-08 12:32:17 +01:00
export
function
sqlLikeEscape
(
s
:
string
)
{
format
2023-05-07 02:46:07 +02:00
return
s
.
replace
(
/([%_])/g
,
"\\$1"
)
;
(partially) cherry-picked from misskey/10e526b fix: Escape SQL LIKE * SQL LIKE escape * CHANGELOG
2023-01-08 12:32:17 +01:00
}
Reference in a new issue
Copy permalink