I have a case where I need to determine whether or not a request is coming from a trusted proxy, so I'm passing the IP address wfIsTrustedProxy(). In order to get the correct IP address to check, I need to pull the IP address from the remote_addr header. WebRequest::getRawIP() already does this, but it's a protected method, so I've gone ahead and duplicated the functionality for myself, but that always makes me feel weird. Is there any reason not to make it a public method instead? I imagine there are other cases where this would also be useful.
Le 21/02/12 22:38, Arthur Richards a écrit :
WebRequest::getRawIP() already does this, but it's a protected method
That probably deserve being public. Feel free to talk about it to Aaron Schulz in the office
The method was added with r94932.
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/94932
wikitech-l@lists.wikimedia.org