History log of /web-php/include/ip-to-country.inc (Results 1 – 25 of 39)
Revision Date Author Comments
# 25d2dc1c 07-Dec-2023 Andreas Möller

Enhancement: Enable `no_spaces_after_function_name` fixer (#883)


# 00342c40 07-Dec-2023 Andreas Möller

Fix: Remove vim instruction (#880)


# 45d49c7e 07-Dec-2023 Andreas Möller

Fix: Remove emacs instruction (#876)


# c093fb53 06-Dec-2023 Andreas Möller

Enhancement: Enable `trailing_comma_in_multiline` fixer (#647)

* Enhancement: Enable and configure trailing_comma_in_multiline fixer

* Fix: Run 'make coding-standards'


# 1ebc2c49 22-Aug-2022 Andreas Möller

Enhancement: Enable `binary_operator_spaces` fixer

Closes GH-667.


# d9bcfed4 22-Aug-2022 Andreas Möller

Enhancement: Enable `array_syntax` fixer

Co-authored-by: MathiasReker <mathias@reker.dk>

Closes GH-659.


# 5c9eab2f 15-Jul-2022 Christoph M. Becker

Fix CS violations (case of null, false and true)


# b575ebd4 15-Jul-2022 Andreas Möller

Enhancement: Include `*.inc` files (with exceptions)

Closes GH-662.


# 1b83fd7a 03-Jul-2022 Ayesh Karunaratne

Multiple micro-optimizations

* Replace `ob_get_contents();ob_clean()` with `ob_get_clean()`

`ob_get_clean()` is equivalent to `ob_get_contents()` followed by `ob_clean()`.

Multiple micro-optimizations

* Replace `ob_get_contents();ob_clean()` with `ob_get_clean()`

`ob_get_clean()` is equivalent to `ob_get_contents()` followed by `ob_clean()`.

* Replace `intval()` calls with `(int)` type cast

This is a micro-optimization because `intval()` is a function call, and the type cast is about 6 times fast.

* Replace `preg_replace` call that could be done with an `rtrim()` call

In `./error.php`, there is a `preg_replace('!/+$!', '', $URI);` call that essentially is equivalent to `rtrim()`, that both calls removing trailing slash characters in `$URI`.
The `rtim()` call is more legible and faster.

* Combine consecutive `str_replace` calls to a single `str_replace` call

* Use short ternary operator where possible

Improves code readability.

* Cascade various `else` statements where possible

Cleans up the code by removing unnecessary `else` blocks and moving the code to the parent context if the previous `if` block exits the function by either terminating the script, or with a `return` statement.

* Combine multiple `isset()` calls to a single `isset()`

`isset()` accepts multiple parameters and returns `true` only if all of the parameters are `isset`. It makes sense to combine multiple individual `isset` calls to a single call for better readability.

* Replace `for` loop with a `foreach` loop

* Remove unnecessary character escapes in regular expressions

Regular expression special characters are context-sensitive. For example, special characters such as `.` are not considered special within square braces (`[]`).
This removes several of such instances that certain characters are escaped, but it is not strictly necessary within the context. This improves the readability of the expression.

See more information at [PHP.Watch: Writing better Regular Expressions in PHP](https://php.watch/articles/php-regex-readability#reduce-escape)

* Remove unnecessary break statement

* Remove unnecessary PHP close tags

* Remove redundant JSON_ERROR_NONE check

Remove unnecessary `json_last_error() == JSON_ERROR_NONE` where the decoded object is inspected already.

Closes GH-603.

show more ...


# 38d4e072 02-Jul-2022 Ayesh Karunaratne

`phpversion()` replacements and code branch collapsing for older PHP versions

Closes GH-600.


# 2735e5f0 31-May-2019 Sara Golemon

Swap uses of _SERVER[DOCUMENT_ROOT] for __DIR__

1/n - Update / and /include/ only.


# e235f794 17-Oct-2018 Peter Kokot

Trim trailing whitespace

This patch cleans all redundant trailing whitespace across the
repository except for the icalendar files.


# 0f95b8c7 30-Jun-2018 Peter Kokot

Remove unused Git attributes ident

The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
use

Remove unused Git attributes ident

The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.

show more ...


# 0344cc1f 04-Dec-2013 Hannes Magnusson

Fix a warning with the new example files


# f8f006b8 18-Sep-2013 Jacques Marneweck

Ignore RFC 6598's 100.64.0.0/10 which is used by carrier grade nat devices and should not be routable on the internet

Signed-off-by: Jacques Marneweck <jacques@powertrip.co.za>


# ce887dab 31-Oct-2009 Philip Olson

reverted last commit, see http://news.php.net/php.mirrors/37754


# 3bdb9ac7 31-Oct-2009 Sean Coates

check for ip-to-country index before opening it, to be safe


# 7934b33a 02-Feb-2007 Nuno Lopes

fix #40301: regex didnt ignore some local IPs. also convert ereg to preg_match


# 4ab74935 11-Oct-2004 Gabor Hojtsy

seek one record before the record we find (modified patch by Bakr Alsharif) - hope this fixes IP lookup problems


# 0712ec58 07-Aug-2004 Jacques Marneweck

Fixes merged from php-bugs-web relating to bug #29151.


# 325b789f 18-Sep-2003 Gabor Hojtsy

Give priority to HTTP_CLIENT_IP over REMOTE_ADDR and
HTTP_X_FORWARDED_FOR, suggested by Nuno Lopes.


# bc78f803 27-May-2003 Gabor Hojtsy

Remove PHP < 4.1.0 BC code
- the creation of $_.. vars
- global-ing them before usage

These are not needed anymore, we have all mirrors with
PHP > 4.1.0, and those having old v

Remove PHP < 4.1.0 BC code
- the creation of $_.. vars
- global-ing them before usage

These are not needed anymore, we have all mirrors with
PHP > 4.1.0, and those having old versions are disabled

show more ...


# 52702cdd 26-May-2003 Gabor Hojtsy

This search in the index was causing most of the IPs
to be hidden in the db since I have added the speed
increase fix. The previous ranges were checked for IPs
instead of the actual range

This search in the index was causing most of the IPs
to be hidden in the db since I have added the speed
increase fix. The previous ranges were checked for IPs
instead of the actual range where the IP was [because ==
was true for the upper part of the region].

Now we search in one region up, and that makes this
whole code work again without any more resource needs.

Plus it also finds Rasmus' home IP finally ;))

show more ...


# 55513d6a 25-May-2003 Gabor Hojtsy

Drop out ugly workaround to make the country lookup work
The database has errors, so we need to wait for that to be
fixed...

Some speed fixes:

- do not search in the DB if

Drop out ugly workaround to make the country lookup work
The database has errors, so we need to wait for that to be
fixed...

Some speed fixes:

- do not search in the DB if we were unable to find any
helpful data in the index. A full DB search is something
we should not do because of performance reasons

- return a two element array in the index lookup specifying
a range where the IP should be in the DB (if it is correct).
If we pass that range, we were unable to find the IP.
This reduces the number of compared records significantly

Note that this is not a fix for Rasmus' and others'
lookup problems. That is caued by the DB containing
overlapping IP ranges, which are not OK for our indexer,
and would even not return valid results in an SQL
'BETWEEN' search [which is the recommended search
method on ip-to-country.com].

show more ...


# 0883c55d 24-May-2003 Jacques Marneweck

- Another better fix seeing that it does not process more of the
ip-to-country database file than necessary as well as adding a failsafe
so we only do a max of 3 lookups and move the inde

- Another better fix seeing that it does not process more of the
ip-to-country database file than necessary as well as adding a failsafe
so we only do a max of 3 lookups and move the index down each time by
one.

show more ...


12