Is it just me tripping on using the bloody LIKE for searching like it still 1989* and something like keyword-based search and ordering by relevance hasn't even been dreamed up yet?
I edited in the * for simplicity and to hide our db column and table names
There are so many ways round this it's absolutely ridiculous, it doesn't even trim spaces!
I cannot believe how incompetent/dangerous our previous supplier was. There are quite a few things like this we found, including on an internal system a web forms text box you could insert any sql string to apply to the db. It's important to understand they thought about security there, they ensured you couldn't start your command with DROP, but... if you added space in front of DROP...
6
u/auctorel Aug 26 '21
Lightly edited to hide table names but genuinely found in our legacy codebase
14
u/[deleted] Aug 26 '21
Image Transcription: Code
I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!
4
u/Inopmin Aug 26 '21
What is a prepared statement anyways
2
u/thanatica Sep 01 '21
Is it just me tripping on using the bloody
LIKEfor searching like it still 1989* and something like keyword-based search and ordering by relevance hasn't even been dreamed up yet?(* MS SQL Server release year)
1
u/dydzio Aug 31 '21
this is how i write sql as full stack dev
0
u/[deleted] Aug 26 '21
[deleted] — view deleted comment