summaryrefslogtreecommitdiff
path: root/src/sp_utils.c
diff options
context:
space:
mode:
authorBen Fuhrmannek2021-08-02 10:42:12 +0200
committerBen Fuhrmannek2021-08-02 10:42:12 +0200
commit4cda0120313dfd5d71236f6faf87416e93f5f89c (patch)
tree0c2c6d15e8ac5287fb3304f96de719547d9e847a /src/sp_utils.c
parent6c132e6a1d8d339a20282afb5a4af52eb6bce9db (diff)
parente62f226c3ed885808c832040872fc2d73ca46dac (diff)
Merge branch 'master' of https://github.com/jvoisin/snuffleupagus
Diffstat (limited to 'src/sp_utils.c')
-rw-r--r--src/sp_utils.c18
1 files changed, 0 insertions, 18 deletions
diff --git a/src/sp_utils.c b/src/sp_utils.c
index 73c0546..5f25920 100644
--- a/src/sp_utils.c
+++ b/src/sp_utils.c
@@ -19,24 +19,6 @@ const char* get_ipaddr() {
19 return fwd_ip; 19 return fwd_ip;
20 } 20 }
21 21
22 /* Some hosters (like heroku, see
23 * https://github.com/jvoisin/snuffleupagus/issues/336) are clearing the
24 * environment variables, so we don't have access to them, hence why we're
25 * resorting to $_SERVER['REMOTE_ADDR'].
26 */
27 if (!Z_ISUNDEF(PG(http_globals)[TRACK_VARS_SERVER])) {
28 const zval* const globals_client_ip =
29 zend_hash_str_find(Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER]),
30 "REMOTE_ADDR", sizeof("REMOTE_ADDR") - 1);
31 if (globals_client_ip) {
32 if (Z_TYPE_P(globals_client_ip) == IS_STRING) {
33 if (Z_STRLEN_P(globals_client_ip) != 0) {
34 return estrdup(Z_STRVAL_P(globals_client_ip));
35 }
36 }
37 }
38 }
39
40 return default_ipaddr; 22 return default_ipaddr;
41} 23}
42 24