Thanks for the quick reply, @tw2113
I’m not sure why this issue presents differently for you. I tried to be careful and use a standard theme, no unnecessary plugins and clear my cache when testing. Tried again just now and it still shows up for logged in and logged out users at my end.
However, I believe you have identified the right piece of code, as it doesn’t seem to be able to fully distinguish between the user’s own profile and that of another.
It is an edge case. However, if the profiles were ever crawled, or linked somewhere else, before changing the network to private, this could be a real privacy issue.
As I am updating a page that’s been setup before I joined the project, this might very well be the case. So, thank you for looking into it!