Commit graph

58 commits

Author SHA1 Message Date
Alexandre Emsenhuber
bccd2ad03b fix some doxygen errors 2009-12-11 22:19:37 +00:00
Alexandre Emsenhuber
2d0dd7959c $fname -> __METHOD__ 2009-11-07 14:23:09 +00:00
OverlordQ
033860134c Followup to r52671, fix redirection syntax to work with windows as well. 2009-08-25 15:47:46 +00:00
Chad Horohoe
1219a4f717 Use wfGetNull() instead of hardcoded /dev/null 2009-07-02 00:55:48 +00:00
Alexandre Emsenhuber
5b2c98b2ef Fix for r51774, r51784: set '127.0.0.1' as IP for CLI, but with explicit check for $wgCommandLineMode so that the exception "Unable to determine IP" is not thrown in this case. 2009-06-12 09:34:49 +00:00
Alexandre Emsenhuber
8f79397a7c Fixes for r51774:
* declare $ip and $ipchain so that it doesn't throw notices and warnings
* don't set $ip to false after getting it from $_SERVER['REMOTE_ADDR'], otherwise it won't work when there's no XFF header
* fix logic when throwing the exception: throw it when there's no IP
2009-06-12 09:17:21 +00:00
Chad Horohoe
026546e3ad Revert r51725 (fall back to 127.0.0.1 when IP cannot be determined). On further discussion, it's best if we don't make up a fake IP. Tweak the logic here a bit (per Tim) to let XFF attempt to determine the actual IP. Throw an exception if we can't. 2009-06-12 01:34:44 +00:00
Chad Horohoe
38b5865216 (bug 18173) Login form exception on malformed REMOTE_ADDR, wfGetIP() now falls back to 127.0.01 if the IP cannot be determined, which is more sane than returning null. 2009-06-11 03:20:15 +00:00
Brion Vibber
4e01dba6cc Revert r44254 "Cleanup to wfGetNull(): * Add override in case /dev/null isn't accessible (bug 11009)"
Doesn't seem like a proper fix here... At best, this'll be dumping random crap to some random file unless the user has a local copy of the /dev/null device file, which seems.... wrong. :)
For anything generating command lines, it probably won't make any difference (assuming exec() is enabled at all!) since open_basedir won't be searching through the command line (I think).
Assuming the core use case actually happens (open_basedir is set, but proc_open() is available to run tidy), a more correct fix is probably to go ahead and read in stderr and toss the results, or maybe better pass it through to PHP's stderr FD instead of opening /dev/null ourselves. Tidy has a -q option which should suppress random "hi i'm tidy version XYZ" if it's currently present.
2008-12-10 22:58:24 +00:00
Chad Horohoe
f36d56a2fe Cleanup to wfGetNull():
* Add override in case /dev/null isn't accessible (bug 11009)
* Use wfGetNull() in ProxyTools rather than hardcoding it
2008-12-05 17:25:22 +00:00
Charles Melbye
a83333c4a5 Added a new configuration option ($wgUsePrivateIPs) to force MediaWiki to use forwarded Private IPs from a Proxy server 2008-11-20 23:30:08 +00:00
Tim Starling
9e103d3dc3 Reverting r40323, as per comments on wikitech-l. Deprecated doesn't mean removed. It doesn't even mean it'll be removed in the future. It just means you shouldn't use it. 2008-09-03 02:28:41 +00:00
Chad Horohoe
85eee307b2 Fully deprecate $wgProxyKey. Has been marked as deprecated since 1.4, but never seems to have been done. Sites with $wgProxyKey set will continue to use the setting (added a fallback in Setup). Fixes bugs 9258 and 12089. 2008-09-02 15:15:54 +00:00
Tim Starling
9a70df9bf1 Removed the AOL hack. Use the TrustedXFF extension instead. 2008-08-24 06:45:07 +00:00
Aryeh Gregor
efddfe98e4 Add comment explaining mystery list of IP addresses 2008-07-01 22:30:06 +00:00
Alexandre Emsenhuber
087a9f70c5 WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>

Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage

One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
Siebrand Mazeland
79d5225c0e * remove end of line whitespace
* remove empty lines at end of file
* remove "?>" where still present
2008-04-14 07:45:50 +00:00
Alexandre Emsenhuber
cf0fb622b5 Withespaces fixes. 2008-03-08 16:22:05 +00:00
Anders Wegge Jakobsen
65f73d8439 Fix for 13281: Normalize header names as per RFC 2616 2008-03-07 22:12:34 +00:00
Alexandre Emsenhuber
7248aeaaff * Update docs/memcached.txt
* Kill call to $wgUseMemCached in includes/ProxyTools.php
2008-03-01 15:08:49 +00:00
Aryeh Gregor
a15c419b3d Remove ?>'s from files. They're pointless, and just asking for people to mess with the files and add trailing whitespace. (Yes, I looked over every one and reverted those that were bogus. Slash-enter a million times in less worked well enough, although it was a bit mind-numbing.) 2007-06-29 01:19:14 +00:00
Aaron Schulz
72dd9a7e4d *Remove wfGetLastIPfromXFF() from r19889 2007-04-24 19:00:45 +00:00
Brion Vibber
cc8e3c5a4b Reverting more fucked up untested code from r21448 and r21449 2007-04-24 14:31:52 +00:00
Aaron Schulz
d1ff03cd1d *Document some older functions 2007-04-23 18:06:37 +00:00
Aaron Schulz
b30bf261f4 *Remove wfGetLastIPfromXFF(), add a new wfGetClientIPfromXFF(), which was removed in r21353 2007-04-21 16:45:36 +00:00
Brion Vibber
a1b4a52dc4 *stab stab stab* 2007-04-19 13:59:00 +00:00
Brion Vibber
6273156469 wfGetLastIPfromXFF() was clearly never tested either because it also DOESN'T FUCKING WORK
and HAS NO FUCKING DOCUMENTATION
and CAUSES ERRORS AND FAILURES
This quick hack should make it appear to basically work, assuming it does anything useful at all.
2007-04-19 13:33:13 +00:00
Brion Vibber
f203eb5234 Revert r21158 and r21159 -- clearly broken code.
wfGetClientIPfromXFF() uses undeclared variables -- it will never return a non-null value, but will in most cases trigger PHP notices about accessing unused variables.
It's also not documented as to what it does or how it's supposed to differ from the functions above it.
Please document, rewrite, and test this function if it is required.
2007-04-18 18:53:54 +00:00
Aaron Schulz
ab27a284a1 Some xff function cleanup; add a function to get the leftmost ip 2007-04-10 16:07:42 +00:00
Aaron Schulz
ac03a462ff * Add IPv6 support to XFF functions, improve IPv6 regexp 2007-03-12 18:15:58 +00:00
Aaron Schulz
569fa7cf8b *Have user agent return '' rather than NULL 2007-03-09 22:57:25 +00:00
Aaron Schulz
8f5d64dd2c * Added useragent and an xff function and header 2007-02-12 01:02:35 +00:00
Antoine Musso
c771fc9c96 Use Doxygen @addtogroup instead of phpdoc @package && @subpackage 2007-01-20 15:09:52 +00:00
Ilmari Karonen
fd989dcea6 convert "::1" and other pseudo-IPv6 addresses that Apache may throw at us to their IPv4 counterparts 2006-11-29 08:08:57 +00:00
Tim Starling
a3a6ac13c3 * Added temporary special-case AOL proxy detection, they're automatically counted as trusted proxies for now.
* Removed wfRangeStartEnd() and wfIsAddressInRange() -- avoid proliferation of global functions.
2006-11-25 16:24:44 +00:00
Tim Starling
a3b490d2c4 * Made special page names case-insensitive and localisable. Care has been taken to maintain backwards compatibility.
* Used special page subpages in a few more places, instead of query parameters
2006-10-30 06:25:31 +00:00
Tim Starling
e174a4ddfb Abolished $wgDBname as a unique wiki identifier, it doesn't work with the new-fangled feature we call "table prefixes". Instead use wfWikiID() for an identifier containing the DB name and the prefix if there is one, and wfMemcKey() for cache key construction.
Caches for wikis with table prefixes will be lost on upgrade, caches for wikis without table prefixes will be preserved. Custom cache keys in extensions can be migrated at leisure. Extensions which write to core cache keys should be migrated ASAP, as I have done with Special:Makesysop.
2006-10-04 09:06:18 +00:00
Tim Starling
3e50848357 Moved wfParseCIDR() to IP::parseCIDR(). Added IP::parseRange() to support more general range strings. An application for this will hopefully follow soon. 2006-09-24 06:11:21 +00:00
Tim Starling
0ade783ae2 Deferred loading of DateFormatter.php and IP.php. Standardised IP.php function naming style. 2006-07-14 17:02:49 +00:00
Antoine Musso
71fd92d760 Migrate IP related tools from ProxyTools.php to IP.php
and its own class of static functions
2006-07-12 18:33:21 +00:00
Brion Vibber
0a26267688 Revert to r14512; domas introduced massive breakage with incomplete experimental changes. They will be recommitted when they work. :) 2006-06-01 08:19:02 +00:00
Domas Mituzas
bda0b8e104 Use AutoLoader to load classes:
* remove require_once() throughout whole code, yet left in few places
* move global functions in HttpUtils, ProxyTools, Credits to class methods
* php5 only: __autoload() now used, combined with class->file map and require()
* move initialization of $wgValidSkinNames to Skin::getSkinNames()
* few more changes that will surely break stuff.
2006-06-01 07:22:49 +00:00
Brion Vibber
bfe9356a07 * Reject malformed addresses in X-Forwarded-For entries 2006-04-13 01:03:30 +00:00
Domas Mituzas
8aabcc03d1 Be less anal about entry points, class definitions do no harm to anyone, defined() is expensive 2006-01-14 11:04:04 +00:00
Brion Vibber
266d41f165 * Added wfDie() wrapper, and some manual die(-1), to force the return code
to the shell to return nonzero when we crap out with an error.
2006-01-14 02:49:43 +00:00
Niklas Laxström
72bfc638b4 Missing variable declarations 2006-01-10 18:44:39 +00:00
Brion Vibber
96a988f7ec * Protect against spoofing of X-Forwarded-For header 2006-01-07 21:44:10 +00:00
Ævar Arnfjörð Bjarmason
a26d5a49d7 * s~\t+$~~ 2006-01-07 13:31:29 +00:00
Ævar Arnfjörð Bjarmason
7bbe971aec * s~ +$~~ 2006-01-07 13:09:30 +00:00
Ævar Arnfjörð Bjarmason
1d15461a57 Code review!
* Don't start a new scope with if defined 'MEDIAWIKI...
2006-01-07 12:31:39 +00:00