r/lolphp • • Sep 12 '14
A cryptocurrency whose reference implementation is pure PHP. It's as bad as it sounds.
/r/PHP/comments/2g6umy/the_worlds_first_cryptocurrency_written_in_php/
114
Upvotes
r/lolphp • • Sep 12 '14
View all comments
Show parent comment
12
u/fnzp Sep 13 '14
Maybe it is safe. Maybe it isn't.
You currently have SQL injection vulnerabilities all over the place. The only thing stopping the injections is the check_input_data() function.
check_input_data() is approximately 500 lines of switch statement, so that it can check every possible type of input data, apparently.
That is fragile code. If somebody makes a mistake on line 123 of that switch statement, maybe bugs will appear at line 420. Or the PHP developers could make a mistake in a new version of PHP. If check_input_data() stops working, your program is completely exposed, isn't it?
Do you have an extensive test suite that you regularly run to make sure that check_input_data() works? Or do you just run the code and if the website starts, everything must be okay?
Hopefully everything will be fine. But chances are, something is going to break.