History log of /dokuwiki/inc/Ip.php (Results 1 – 20 of 20)
Revision Date Author Comments
# 85cddb53 18-Apr-2026 Andreas Gohr <andi@splitbrain.org>

Merge branch 'client_ip_header'

* client_ip_header:
Clean up stale realip references after client_ip_header rename
remove realip option, add default in conf/dokuwiki.php
convert tests to data

Merge branch 'client_ip_header'

* client_ip_header:
Clean up stale realip references after client_ip_header rename
remove realip option, add default in conf/dokuwiki.php
convert tests to data provider
add comment to the real-ip test
add custom client_ip_header

show more ...


# 90c2f6e3 18-Apr-2026 Andreas Gohr <andi@splitbrain.org>

Clean up stale realip references after client_ip_header rename

Update docblocks in Ip.php and common.php, fix old tests to use
the new config key, remove outdated translations, fix method casing
in

Clean up stale realip references after client_ip_header rename

Update docblocks in Ip.php and common.php, fix old tests to use
the new config key, remove outdated translations, fix method casing
in test, and add example to English config description.

show more ...


# fe6048cc 14-Apr-2026 Alexander Lehmann <alexlehm@gmail.com>

remove realip option, add default in conf/dokuwiki.php


# 743a6908 11-Apr-2026 splitbrain <86426+splitbrain@users.noreply.github.com>

�� Rector and PHPCS fixes


# 3da79fe1 10-Apr-2026 Andreas Gohr <andi@splitbrain.org>

Merge pull request #4490 from WillForan/32bitpack

32bit IPv6 unpack


# 093fe67e 07-Mar-2026 Andreas Gohr <andi@splitbrain.org>

updated rector and applied it


# 2b760c9f 15-Jan-2026 Alexander Lehmann <alexlehm@gmail.com>

add custom client_ip_header


# 2f70db90 04-Dec-2025 WillForan <willforan@gmail.com>

fix: 32bit IP tests w/string of decimal representation, overflows

Math in PHP is hard!
sprintf("%.0f",0x7FFFFFFFFFFFFFFF) == sprintf("%.0f",0x7FFFFFFFFFFFFF00)

Changes
* 32bit gets own version o

fix: 32bit IP tests w/string of decimal representation, overflows

Math in PHP is hard!
sprintf("%.0f",0x7FFFFFFFFFFFFFFF) == sprintf("%.0f",0x7FFFFFFFFFFFFF00)

Changes
* 32bit gets own version of tests where expected values are strings
* decimalToBinary32 to replace `sprintf("%032b%032b"...)`, avoids overflow
* overflow check in ipv4 too
* refactor
* partsTo64 for 32bit parts into dec value as str (bcmath)
* Ip32::$b32 as class constant
* condition always PHP_INT_SIZE == 4 for 32bit (instead of == 8 for 64)

show more ...


# a060f5a0 04-Dec-2025 WillForan <willforan@gmail.com>

refactor(ip): PSR-12 functions

bitmask64_32 -> bitmask64On32
make_bitmask_32 -> makeBitmaskOn32
ipv6_upper_lower_32 -> ipv6UpperLowerOn32

also
* uncomment working 7FFF ipv6 test a

refactor(ip): PSR-12 functions

bitmask64_32 -> bitmask64On32
make_bitmask_32 -> makeBitmaskOn32
ipv6_upper_lower_32 -> ipv6UpperLowerOn32

also
* uncomment working 7FFF ipv6 test and
* fix README suggested podman to use `docker://wpstaging`

show more ...


# 91da8d44 20-Sep-2025 WillForan <willforan@gmail.com>

chore(inc/Ip32): move 32bit funcs into own file/class.

easier to remove when x86 is officially deprecated


# e7cd6878 20-Sep-2025 WillForan <willforan@gmail.com>

Merge remote-tracking branch 'upstream/master' into 32bitpack


# 25a70af9 20-Sep-2025 WillForan <willforan@gmail.com>

fix(inc/Ip): 32bit arch compatible range check

* added docs about running tests on 32bit w/ podman.
* Updated tests to use string instead of int for comparison when 32bit.
* added `make_bitmask_3

fix(inc/Ip): 32bit arch compatible range check

* added docs about running tests on 32bit w/ podman.
* Updated tests to use string instead of int for comparison when 32bit.
* added `make_bitmask_32` and `bitmask64_32`. updated `ipInRange` to
use them.

Test failing for `test_ip_to_number`
```
podman run -v $PWD/..:/dokuwiki \
--workdir /dokuwiki/_test -it \
docker://wpstaging/php:8.3-32bit \
./vendor/bin/phpunit --verbose --stderr --filter ip_test
```

```

1) ip_test::test_ip_to_number with data set #3 ('38AF:3033:AA39:CDE3:1A46:094C...D:5300', 6, 4.084536385505709E+18, 1.8932109165344407E+18)
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'4084536385505709056'
+'4084536381210742243'

/dokuwiki/_test/tests/inc/Ip.test.php:52

2) ip_test::test_ip_to_number with data set #5 ('193.53.125.7', 4, 0, 3241508103)
Failed asserting that -1053459193 is identical to 3241508103.

```

show more ...


# da569c7f 23-Jul-2025 WillForan <willforan@gmail.com>

refactor: ipv6_upper_lower_32 from ipToNumber

pull 32-bit specific code into it's own function
hopefully to be tested in _test/tests/inc/Ip.test.php (?)

Stuck on differnce between J2 and N4
J shoul

refactor: ipv6_upper_lower_32 from ipToNumber

pull 32-bit specific code into it's own function
hopefully to be tested in _test/tests/inc/Ip.test.php (?)

Stuck on differnce between J2 and N4
J should be **unsigned** 64 bit, big endian byte order long
but see negatives!?

$ip = inet_pton('ffff:ffff:ffff:fff0:ffff:ffff:ffff:ffff');
print_r(unpack('J2', $ip));
Array
(
[1] => -16
[2] => -1
)

For reference

print_r(unpack('N4', $ip));
Array
(
[1] => 4294967295
[2] => 4294967280
[3] => 4294967295
[4] => 4294967295
)

print_r(unpack('v8', $ip));
Array
(
[1] => 65535
[2] => 65535
[3] => 65535
[4] => 61695
[5] => 65535
[6] => 65535
[7] => 65535
[8] => 65535
)

show more ...


# c9e618ca 23-Jul-2025 WillForan <willforan@gmail.com>

WIP: ipv6 calc for 32bit #4485 (LLM slop)

first pass with chatGPT


# 7caad012 04-Jun-2025 Andreas Gohr <gohr@cosmocode.de>

extend tests, fix issues with new Ip methods


# 33cb4e01 03-Jun-2025 Andreas Gohr <gohr@cosmocode.de>

Make is_ssl and baseurl use proper proxy checks

This should not only address #4455 but also ensures that the related
headers are only used when they come from a trusted reverse proxy chain.


# ced0b55f 09-Jan-2025 Andreas Gohr <andi@splitbrain.org>

Fix Ip tests

We no longer use the old regexp based config, so the tests failed.


# 19d5ba27 09-Jan-2025 Andreas Gohr <andi@splitbrain.org>

rename trustedproxy option to trustedproxies

We use a new format (array instead of regex) and need a sure way to
recognize it. Zebra's approach would not have survived the editing via
config manager

rename trustedproxy option to trustedproxies

We use a new format (array instead of regex) and need a sure way to
recognize it. Zebra's approach would not have survived the editing via
config manager.
As a side effect this also introduces a new languange string, which is
good because the old one did no longer apply.

show more ...


# e449acd0 09-Jan-2025 Andreas Gohr <andi@splitbrain.org>

some small cleanups in Ip class

most importantly do not crash on invalid config


# c7f6b7b7 26-Oct-2022 Zebra North <mrzebra@mrzebra.co.uk>

Move IP functions into a class