"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "system/src/Grav/Common/Uri.php" between
grav-v1.7.17.zip and grav-v1.7.18.zip

About: Grav is a fast, simple, and flexible flat-file based CMS platform (using YAML and PHP). Contents are just simple markdown files in folders with optional extensions via API and hooks.

Uri.php  (grav-v1.7.17):Uri.php  (grav-v1.7.18)
skipping to change at line 676 skipping to change at line 676
return '/\/{1,}([^\:\#\/\?]*' . Grav::instance()['config']->get('system. param_sep') . '[^\:\#\/\?]*)/'; return '/\/{1,}([^\:\#\/\?]*' . Grav::instance()['config']->get('system. param_sep') . '[^\:\#\/\?]*)/';
} }
/** /**
* Return the IP address of the current user * Return the IP address of the current user
* *
* @return string ip address * @return string ip address
*/ */
public static function ip() public static function ip()
{ {
$ip = 'UNKNOWN';
if (getenv('HTTP_CLIENT_IP')) { if (getenv('HTTP_CLIENT_IP')) {
$ip = getenv('HTTP_CLIENT_IP'); $ip = getenv('HTTP_CLIENT_IP');
} elseif (getenv('HTTP_CF_CONNECTING_IP')) {
$ip = getenv('HTTP_CF_CONNECTING_IP');
} elseif (getenv('HTTP_X_FORWARDED_FOR') && Grav::instance()['config']-> get('system.http_x_forwarded.ip')) { } elseif (getenv('HTTP_X_FORWARDED_FOR') && Grav::instance()['config']-> get('system.http_x_forwarded.ip')) {
$ip = getenv('HTTP_X_FORWARDED_FOR'); $ips = array_map('trim', explode(',', getenv('HTTP_X_FORWARDED_FOR')
));
$ip = array_shift($ips);
} elseif (getenv('HTTP_X_FORWARDED') && Grav::instance()['config']->get( 'system.http_x_forwarded.ip')) { } elseif (getenv('HTTP_X_FORWARDED') && Grav::instance()['config']->get( 'system.http_x_forwarded.ip')) {
$ip = getenv('HTTP_X_FORWARDED'); $ip = getenv('HTTP_X_FORWARDED');
} elseif (getenv('HTTP_FORWARDED_FOR')) { } elseif (getenv('HTTP_FORWARDED_FOR')) {
$ip = getenv('HTTP_FORWARDED_FOR'); $ip = getenv('HTTP_FORWARDED_FOR');
} elseif (getenv('HTTP_FORWARDED')) { } elseif (getenv('HTTP_FORWARDED')) {
$ip = getenv('HTTP_FORWARDED'); $ip = getenv('HTTP_FORWARDED');
} elseif (getenv('REMOTE_ADDR')) { } elseif (getenv('REMOTE_ADDR')) {
$ip = getenv('REMOTE_ADDR'); $ip = getenv('REMOTE_ADDR');
} else {
$ip = 'UNKNOWN';
} }
return $ip; return $ip;
} }
/** /**
* Returns current Uri. * Returns current Uri.
* *
* @return \Grav\Framework\Uri\Uri * @return \Grav\Framework\Uri\Uri
*/ */
 End of changes. 4 change blocks. 
3 lines changed or deleted 7 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)