Why is this PHP ORDER BY unsafe?

Why is this PHP ORDER BY unsafe in a search endpoint. The PHP code interpolates a user supplied sort field into SQL, allowing injection. In PHP apps this exposes data and crashes queries.

#whatswrongwiththisphpcode #phpbug #phpproductionbug #phpdebugging #phpbackend #phpcodereview #phpsecurity #phpperformance #phpreliability #phpapi #phpwebdevelopment #phpengineering #phpsqlinjection #phporderby #phpquery #phpdata...

https://www.youtube.com/watch?v=-GtgcqTDwxE

Why is this PHP ORDER BY unsafe? #phpsecurity

YouTube

PHP Array Key Type Casting Mystery

Can you guess this? PHP array keys get cast automatically. Watch what happens with [1] vs ['1'] vs [true]. The result is wild!

#php #phptricks #codingtips #programmingtutorial #phparrays #arraykeys #typecasting #phpquiz #codingchallenge #phpshorts #arraybehavior #phpdata

https://www.youtube.com/watch?v=oBXSVMxoHBI

PHP Array Key Type Casting Mystery #phpquiz

YouTube