Skip to content

[3.0] Lets moderators track another member's IP addresses - #9718

Merged
live627 merged 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/trackip-other-member
Oct 1, 2026
Merged

live627 merged 1 commit into
SimpleMachines:release-3.0from
albertlast:3.0/trackip-other-member

Conversation

@albertlast

Copy link
Copy Markdown
Collaborator

Description

On a member's profile, Tracking → IP address starts from the address the member last used. TrackIP::execute() read that address from User::$loaded[$this->memID], where only the current user is certain to be. The member whose profile is open is Profile::$member, which is where $this->memID comes from in the first place.

So a moderator could track themselves, but tracking any other member passed null to IP::ip2range():

SMF\IP::ip2range(): Argument #1 ($addr) must be of type string, null given, called in Sources/Actions/TrackIP.php on line 83

and the page was a 500. It now reads the address from Profile::$member.

Tests

tests/Integration/Http/ProfileTrackingTest.php makes a member with a known last address, opens their IP tracking page as the administrator (getting past the password prompt when the forum asks for it), and checks the page starts from that address and logs nothing. Without the fix it gets the 500. Run locally on MySQL and PostgreSQL; tests/Integration/Http is not part of the CI run yet.

The snapshot suite in #9712 pins this page as the fatal error it is today (admin/profile_track_ip), so whichever of the two merges second needs that one snapshot recorded again.

Issues References (Fixes|Related|Closes)

None filed; found by the snapshot suite in #9712.

🤖 Generated with Claude Code

The IP address page of a member's profile starts from the address the
member last used, and read it from User::$loaded. Only the current user is
certain to be there; the profile being viewed is Profile::$member. So a
moderator could track themselves, but tracking anybody else passed null to
IP::ip2range() and ended in a TypeError.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
@live627
live627 merged commit eee5c91 into SimpleMachines:release-3.0 Oct 1, 2026
11 checks passed
albertlast added a commit to albertlast/SMF2.1 that referenced this pull request Oct 5, 2026
profile_track_ip pinned a fatal that SimpleMachines#9718 has fixed, so it now records the
page. features_basic and profile_theme show the time zone select grouped by
country. themes_copy lists the new TimeZoneSelect template and no longer
logs an array to string conversion, which SimpleMachines#9720 fixed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants