Overriding commentInfo['ip']?
Posted: Sun Jan 20, 2013 12:17 am
Hey all -
I'm trying to write in support for X-Forwarded-For without hacking core functions. I've been trying to work with the frontend_saveComment event hook. It looks like eventData and addData come through with some information about the comment, but setting
or
doesn't override commentInfo. I'm not sure if this is possible? I don't really want to hack include/functions_comments.inc.php if I don't have to since it will make upgrades, etc harder.
Thanks!
I'm trying to write in support for X-Forwarded-For without hacking core functions. I've been trying to work with the frontend_saveComment event hook. It looks like eventData and addData come through with some information about the comment, but setting
Code: Select all
eventData['ip'] = getenv('HTTP_X_FORWARDED_FOR') != '' ? getenv('HTTP_X_FORWARDED_FOR') : $_SERVER['REMOTE_ADDR'];
Code: Select all
addData['ip'] = getenv('HTTP_X_FORWARDED_FOR') != '' ? getenv('HTTP_X_FORWARDED_FOR') : $_SERVER['REMOTE_ADDR'];
Thanks!