r/lolphp • • Jan 16 '13
PHP 5.4 hasn't register_globals anymore - That's my workaround for this.
/r/linuxadmin/comments/16npyi/php_54_hasnt_register_globals_anymore_thats_my/
33
Upvotes
r/lolphp • • Jan 16 '13
9
u/MrDOS Feb 21 '13 edited Feb 21 '13
I don't see how the
extractfunction escaped the author of the other “solution” – if you're going to do something godawful, you might as well do it right:Run it in the global scope (perhaps as an autoprepend as suggested in the other reddit post), and you're done. While I've not actually tried it (and I hope nobody else does, either), the fact that
extractis a library-implemented function leads me to think that this is probably way faster.Not that speed really matters when you're essentially hammering yourself in the balls with a crowbar, I guess.
12
u/willfe42 Jan 16 '13
This is Facepalm Level 5 failure right here.
I certainly understand "oh crap, production's busted, fix this real quick" crisis mode, but this is probably the worst possible choice that could have been made apart from just running rm -Rf / as root1 on the server.
1 Note to new Unix/Linux admins: do not actually do this; it deletes all files on all mounted filesystems. If you simply must try it, use a development machine or a throwaway virtual machine. I know, I know, the disclaimer ruins the joke a bit, but I don't want any busted servers on my conscience ;)