Lines Matching +full:server +full:-
55 $maskLengthLower = max(0, $maskLength - 64);
57 $maskUpper = ~0 << intval(64 - $maskLengthUpper);
58 $maskLower = ~0 << intval(64 - $maskLengthLower);
74 * - version: Either '4' or '6'.
75 * - upper: The upper 64 bits of the IP.
76 * - lower: The lower 64 bits of the IP.
136 * Given the IP address of a proxy server, determine whether it is
137 * a known and trusted server.
165 * request has passed through, according to the X-Forwarded-For header.
168 * X-Forwarded-For header must be trusted, as well as the TCP/IP endpoint
184 $forwardedFor = $INPUT->server->str('HTTP_X_FORWARDED_FOR');
191 $remoteAddr = $INPUT->server->str('REMOTE_ADDR');
193 // Get the client address from the X-Forwarded-For header.
194 // X-Forwarded-For: <client> [, <proxy>]...
200 // The remaining items are the proxies through which the X-Forwarded-For
221 * - The X-Real-IP header if $conf[realip] is true.
222 * - The X-Forwarded-For header if all the proxies are trusted by $conf[trustedproxy].
223 * - The TCP/IP connection remote address.
224 * - 0.0.0.0 if all else fails.
226 * The 'realip' config value should only be set to true if the X-Real-IP header
227 * is being added by the web server, otherwise it may be spoofed by the client.
229 * The 'trustedproxy' setting must not allow any IP, otherwise the X-Forwarded-For
244 * - The X-Real-IP header if $conf[realip] is true.
245 * - The X-Forwarded-For header if all the proxies are trusted by $conf[trustedproxies].
246 * - The TCP/IP connection remote address.
247 * - 0.0.0.0 if all else fails.
259 // Use the X-Real-IP header if it is enabled by the configuration.
260 if (!empty($conf['realip']) && $INPUT->server->str('HTTP_X_REAL_IP')) {
261 $ips[] = $INPUT->server->str('HTTP_X_REAL_IP');
264 // Add the X-Forwarded-For addresses if all proxies are trusted.
268 $ips[] = $INPUT->server->str('REMOTE_ADDR');
285 * Get the host name of the server.
289 * - The X-Forwarded-Host header if it exists and the proxies are trusted.
290 * - The HTTP_HOST header.
291 * - The SERVER_NAME header.
292 * - The system's host name.
294 * @return string Returns the host name of the server.
301 $remoteAddr = $INPUT->server->str('REMOTE_ADDR');
302 if ($INPUT->server->str('HTTP_X_FORWARDED_HOST') && self::proxyIsTrusted($remoteAddr)) {
303 return $INPUT->server->str('HTTP_X_FORWARDED_HOST');
304 } elseif ($INPUT->server->str('HTTP_HOST')) {
305 return $INPUT->server->str('HTTP_HOST');
306 } elseif ($INPUT->server->str('SERVER_NAME')) {
307 return $INPUT->server->str('SERVER_NAME');
316 * Will use the X-Forwarded-Proto header if it exists and the proxies are trusted, otherwise
326 $remoteAddr = $INPUT->server->str('REMOTE_ADDR');
327 if ($INPUT->server->has('HTTP_X_FORWARDED_PROTO') && self::proxyIsTrusted($remoteAddr)) {
328 return $INPUT->server->str('HTTP_X_FORWARDED_PROTO') === 'https';
330 return !preg_match('/^(|off|false|disabled)$/i', $INPUT->server->str('HTTPS', 'off'));