Craig Francis
Security, Accessibility, Performance... trying to make the world better.
@mudri@mathstodon.xyz it’s a similar problem with HTML, where templating libraries take HTML string fragments that shouldn’t contain user values; in Go there is safehtml:
https://github.com/google/safehtml
Where they use the "un-exported string type" to ensure the HTML fragments are there during compile time:
https://github.com/craigfrancis/php-is-literal-rfc/blob/main/others/go/index.go
@bohwaz true, and I think SQLite has some really cool features like that… personally I’m trying get MySQL and MariaDB to implement a very simple WHERE id IN (?) with a single placeholder for multiple values, as I still keep seeing people implode(‘, ‘, $ids) directly into the SQL string for some of that SQL Injection fun :-)