Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Issue 1915 Robustify hash of user IP#2463

Open
axel3rd wants to merge 1 commit intoPiwigo:masterfrom
axel3rd:issue-1915-robustify-hash-of-user-ip
Open

Issue 1915 Robustify hash of user IP#2463
axel3rd wants to merge 1 commit intoPiwigo:masterfrom
axel3rd:issue-1915-robustify-hash-of-user-ip

Conversation

@axel3rd
Copy link

@axel3rd axel3rd commented Nov 27, 2025

Hello,

This PR fixes #1915.

On some virtualized environment, the user IP stored in $_SERVER['REMOTE_ADDR'] could be /srv/mp/socket.

In this case, get_remote_addr_session_hash() crashes with:

Fatal error: Uncaught ValueError: The arguments array must contain 2 items, 1 given in /var/www/include/functions_session.inc.php:114 Stack trace: #0 /var/www/include/functions_session.inc.php(114): vsprintf() #1 /var/www/include/functions_session.inc.php(131): get_remote_addr_session_hash() #2 [internal function]: pwg_session_read() #3 /var/www/include/common.inc.php(150): session_start() #4 /var/www/index.php(11): include_once('...') #5 {main} thrown in /var/www/include/functions_session.inc.php on line 114

The solution could be to robustify the IPV4 hash creation only with IP contains some dot.

Best regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

php8.1 issue when accessing home - Alpine containerized VM - Root cause: REMOTE_ADDR = '/srv/mp/socket'

1 participant

Comments