Re:Show HN: A “Write Less, Do More” DB Class Based on PDO [PHP]
by _lce0 on Tuesday December 30, 2014 @05:35PM
(#8817126)
I just want to raise my concern about the security issues the current implementation provides. At a glance the update method provides a simple way to execute arbitrary SQL.
Re:Show HN: A “Write Less, Do More” DB Class Based on PDO [PHP]
by _lce0 on Friday January 02, 2015 @01:26AM
(#8825767)
No matter how hard you try. If queries are dynamically created, you (or your lib's user) will most certainly miss a spot were an attacker cloud sneak an offensive query.
You fixed the $i, but what about $table? What about $conditions's keys?
See the problem? And we are just talking about a single method ;-)
Re:Show HN: A “Write Less, Do More” DB Class Based on PDO [PHP]
by resonantcore on Tuesday December 30, 2014 @04:48PM
(#8816927)
TL;DR - it does everything PDO does (thanks to class inheritance) but also has some nice short-hand methods for getting jobs done quicker. DRY and KISS.
Re:Show HN: A “Write Less, Do More” DB Class Based on PDO [PHP]
by resonantcore on Wednesday December 31, 2014 @01:31PM
(#8820449)
There aren't any, currently. These libraries are ripped from an in-house framework which has some tests already, but none for the classes we extracted. We created the tests folder in anticipation of actually writing some.
Please be aware
https://github.com/resonantcore/lib/blob/7b719907e8954241ff9...
Developer abuse ought to be sufficiently mitigated now. Thanks for saying something :)
You fixed the $i, but what about $table? What about $conditions's keys?
See the problem? And we are just talking about a single method ;-)
I linked to a single commit.
I probably should have linked to the master branch instead. (Also, I just pushed another update as I wrote this.)
https://github.com/resonantcore/lib/blob/master/src/DB.php
https://github.com/resonantcore/lib/commit/dc45efdc36ed51f82...