Lines Matching +full:server +full:-
45 // The mask length must be a non-negative integer.
64 $maskLengthLower = max(0, $maskLength - 64);
72 $maskUpper = ~0 << intval(64 - $maskLengthUpper);
73 $maskLower = ~0 << intval(64 - $maskLengthLower);
92 * - version: Either '4' or '6'.
93 * - upper: The upper 64 bits of the IP.
94 * - lower: The lower 64 bits of the IP.
126 if (PHP_INT_SIZE == 4) { // 32-bit
128 } else { // 64-bit arch
163 * Given the IP address of a proxy server, determine whether it is
164 * a known and trusted server.
192 * request has passed through, according to the X-Forwarded-For header.
195 * X-Forwarded-For header must be trusted, as well as the TCP/IP endpoint
211 $forwardedFor = $INPUT->server->str('HTTP_X_FORWARDED_FOR');
218 $remoteAddr = $INPUT->server->str('REMOTE_ADDR');
220 // Get the client address from the X-Forwarded-For header.
221 // X-Forwarded-For: <client> [, <proxy>]...
227 // The remaining items are the proxies through which the X-Forwarded-For
248 * - The custom IP header if $conf[client_ip_header] is set.
249 * - The X-Forwarded-For header if all the proxies are trusted by $conf[trustedproxy].
250 * - The TCP/IP connection remote address.
251 * - 0.0.0.0 if all else fails.
254 * is being added by the web server, otherwise it may be spoofed by the client.
256 * The 'trustedproxy' setting must not allow any IP, otherwise the X-Forwarded-For
271 * - The custom IP header if $conf[client_ip_header] is set.
272 * - The X-Forwarded-For header if all the proxies are trusted by $conf[trustedproxies].
273 * - The TCP/IP connection remote address.
274 * - 0.0.0.0 if all else fails.
287 …if (!empty($conf['client_ip_header']) && $INPUT->server->str('HTTP_' . $conf['client_ip_header']))…
288 $ips[] = $INPUT->server->str('HTTP_' . $conf['client_ip_header']);
291 // Add the X-Forwarded-For addresses if all proxies are trusted.
295 $ips[] = $INPUT->server->str('REMOTE_ADDR');
312 * Get the host name of the server.
316 * - The X-Forwarded-Host header if it exists and the proxies are trusted.
317 * - The HTTP_HOST header.
318 * - The SERVER_NAME header.
319 * - The system's host name.
321 * @return string Returns the host name of the server.
328 $remoteAddr = $INPUT->server->str('REMOTE_ADDR');
329 if ($INPUT->server->str('HTTP_X_FORWARDED_HOST') && self::proxyIsTrusted($remoteAddr)) {
330 return $INPUT->server->str('HTTP_X_FORWARDED_HOST');
331 } elseif ($INPUT->server->str('HTTP_HOST')) {
332 return $INPUT->server->str('HTTP_HOST');
333 } elseif ($INPUT->server->str('SERVER_NAME')) {
334 return $INPUT->server->str('SERVER_NAME');
343 * Will use the X-Forwarded-Proto header if it exists and the proxies are trusted, otherwise
353 $remoteAddr = $INPUT->server->str('REMOTE_ADDR');
354 if ($INPUT->server->has('HTTP_X_FORWARDED_PROTO') && self::proxyIsTrusted($remoteAddr)) {
355 return $INPUT->server->str('HTTP_X_FORWARDED_PROTO') === 'https';
357 return !preg_match('/^(|off|false|disabled)$/i', $INPUT->server->str('HTTPS', 'off'));