Commit graph

60 commits

Author SHA1 Message Date
Alexandre Emsenhuber
ef9787a85f * Fixed some doxygen warnings
* Removed some useless spaces in the begining of lines
2010-03-09 21:51:05 +00:00
OverlordQ
a989843cd0 Code cleanup, covert leading spaces into tabs per coding style 2009-11-14 21:27:13 +00:00
Aaron Schulz
2e89016676 Take the IPv4 part of mapped addresses rather than broken '.'->':' replace 2009-08-08 01:22:15 +00:00
Aaron Schulz
418e7767b4 IPv6 padding cleanup - removed trailing ':' 2009-07-27 07:03:36 +00:00
Aaron Schulz
c0a1b76624 * IPv6 validation check fix for bug 19003
* Made regexps a bit more readable by breaking lines
2009-07-27 06:08:41 +00:00
Roan Kattouw
d99df49ed7 Fixes for r51236 per CR comments 2009-05-31 15:02:43 +00:00
Roan Kattouw
e7f76a6e77 Fix weird bug that caused IP::isInRange("80.0.0.0", "94.0.0.0/24") to return true because "52000000" >= "5E000000" (52000000 >= 5). Thanks, PHP. 2009-05-31 14:52:16 +00:00
Tim Starling
c954755878 Changes required by the current version of SecurePoll:
* Add IP::formatHex(), the inverse of IP::toHex(). So that you don't have to guess if it's IPv4 or IPv6.
* Rewrite IP::hexToQuad() so it actually works.
2009-04-01 08:54:17 +00:00
Aaron Schulz
3337669b0c * Fix comment
* Rename HexToIP -> HexToQuad
2008-11-02 18:35:58 +00:00
Aryeh Gregor
565fe1cac3 Use MediaWiki whitespace standards, please.
This file is really a mess, though.  We need a unified system of
functions that will autodetect any IP address format and convert to any
desired format, not this hodgepodge of inconsistently-named and
inconsistently-operating hacks.
2008-11-02 17:17:19 +00:00
Roan Kattouw
db6d1ed1dc API: Move ApiQueryBlocks::convertHexIP() to IP::hexToIP() per Werdna's comment on r43040 2008-11-02 16:50:59 +00:00
Siebrand Mazeland
798f535951 * Fix common spelling error (seperate -> separate) 2008-09-15 20:38:27 +00:00
Aaron Schulz
bf388f2ee3 remove extra parenthesis 2008-08-24 22:50:12 +00:00
Aaron Schulz
67430027dc update comment 2008-08-13 23:34:56 +00:00
Aaron Schulz
6e15e8506e add HexToOct() 2008-08-13 16:51:37 +00:00
Brion Vibber
a31753e542 * (bug 15049) Fix for CheckUser extension's log search: usernames containing
a "-" were incorrectly turned into bogus IP range searches.
  Patch by Max Semenik.
2008-08-06 20:54:27 +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
Aaron Schulz
71b3ec988e *Convert '.' to ':' for IPs that have both (like '::eff:1.4.0.3')
*Expand IP dbkeys like "::fff:3e" rather than complain about the double colons
2007-09-03 16:36:25 +00:00
Brion Vibber
977977e314 * Fixed regression in blocking of username '0'
IP::sanitizeIP() for some reason is used to return IP-or-something-that's-not-an-IP, but was incorrectly checking for empties. Thus for '0' input it returned NULL instead of '0'.
2007-08-03 08:51:55 +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
Brion Vibber
d5a8cc2dd1 * (bug 10247) Fix IP address regex to avoid false positive IPv6 matches
Regex fragment IP_ADDRESS_STRING was not parenthesized properly, causing the preg_match in IP::isIPAddress() to get false positives on strings which _ended_ in IPv6 subsequences.
2007-06-13 19:47:44 +00:00
Tim Starling
f79522aa34 debugging 2007-04-25 07:40:00 +00:00
Nick Jenkins
9648f3b4d0 Some small doc tweaks to reduce Doxygen warnings, namely:
* @link. You might think @link would surely mean "here comes a web URL" ... but @link is a valid command 
  in Doxygen, which means an entirely different kind of link (an internal link to somewhere, so that you can separate 
  documentation and implementation). The result is a mess, and the best solution I can see is to use "@see" instead of "@link".
* Warning: argument `nourl' of command @param is not found in the argument list of Linker::makeMediaLinkObj($title,$text='')
* Moving few class descriptions to right above classes, and/or formatting into Javadoc style.
* "@addtogroup Special Pages" --> "@addtogroup SpecialPage" so that all special pages have the same @addtogroup tag.
* @fixme --> @todo (must have missed these before)
* "@param $specialPage @see" remove the "@" in the "@see" to stop warning.
* @throws wants type, then a brief description, to stop warning.

This last one is for PHPdocumentor only, but it fixes something for PHPDocumentor, and should be neutral for Doxygen:
* WARNING in includes/api/ApiFormatYaml_spyc.php on line 860: docblock template never terminated with /**#@-*/
2007-04-18 09:50:10 +00:00
Aaron Schulz
7a1682f7a5 *fix ipv6 prefix consistency 2007-04-08 01:41:41 +00:00
Nick Jenkins
113bb1c772 Documentation tweaks to help documentation systems (Doxygen + PHPDocumentor)
pick up the appropriate tags, and documentation blobs for classes. This is 
the same as per r20769, but with the grouping changes (e.g. removing "@{{") omitted.
Please be advised that more related documentation tweaks may follow later - e.g. 
Doxygen generates a log file of warnings that is 574 Kb in size, when run over 
the just the trunk/phase3 code ... eek! Thankfully, much of that is just 
whining about functions without documentation   ;-)
2007-04-04 05:22:37 +00:00
Aaron Schulz
fa85cc3420 *comment typo 2007-04-04 05:19:33 +00:00
Brion Vibber
3a6ac5a3c3 Revert r20769: we don't use PHPDocumentor anymore, we use doxygen.
If making mass changes to tweak to its preferences, probably better to do it for the tool we actually generate docs with. :)
2007-03-28 14:16:43 +00:00
Nick Jenkins
5fef2333d4 PHPDocumentor [http://en.wikipedia.org/wiki/PhpDocumentor] documentation tweaking stuff.
Minor doc tweaks to prevent some PHPDocumentor warnings or errors when run on the includes/ directory. PHPDocumentor uses a syntax very similar to javadoc - mostly we already use this, but there were a few scattered places that were adjusted to make them consistent with the rest of the code. In practical terms, these changes were made:
* @url becomes @link
* @fixme becomes @todo
* HTML tags in descriptions must be closed / balanced.
* @bug was removed (where the bug was long fixed), or changed into a @todo (in the few situations where the bug was still pending)
* @obsolete becomes @deprecated
* Things like "/**@{{" and "/**@}}*/" which cause "unknown tag" warnings were removed
* @access must be a valid access level.
* @desc tag not needed, removed.
* Doesn't seem to like @licence, will accept @license however.
* Use full comment block notation in a few places (i.e. open block with "/**", start each line with " *", and end block with " */")

Then additional to this, to get some class docs associated with their respective classes:
* Moved some docs to right above those classes (deleting blank lines, or moving descriptions from the file headers)
* Marked some classes without docs as "@todo document"
* (done up to "class MIMEsearchPage" on the "classtrees_MediaWiki.html" page for the includes/ directory)
2007-03-28 08:53:02 +00:00
Aaron Schulz
17b53cedd4 *Fix isInRange(), remove cruft, add "ipv-6" prefix to toHex() and parseRange6(), actually show hidename option for blocks 2007-03-28 05:39:06 +00:00
Aaron Schulz
04a0d93878 *Fix comment typo, remove some redundant conversions 2007-03-22 22:08:31 +00:00
Aaron Schulz
b016603be8 *Run isIPv6() before trim/uppercasing 2007-03-14 05:23:17 +00:00
Aaron Schulz
93ffe9c200 *More robust IPv6 validation (exclude ambiguous IPs) 2007-03-13 19:25:49 +00:00
Aaron Schulz
1bfe3eb527 *Make sanitizeIP() and toOctet() remove leading bloc zeroes instead, fix bug with ::x IPs 2007-03-13 18:43:52 +00:00
Brion Vibber
761bfca76a this isn't java... you need to say $this-> and self:: explicitly 2007-03-13 18:03:47 +00:00
Aaron Schulz
45239a493a *sanitizeIP() now adds leading zeroes to each bloc for better consistency 2007-03-13 17:15:02 +00:00
Aaron Schulz
f992eac1a3 *Padding for indexing 2007-03-13 09:25:41 +00:00
Aaron Schulz
3987c91369 *Declare static functions as such 2007-03-13 04:55:47 +00:00
Aaron Schulz
915f83d7b4 *IPv6 sanitizing, avoid use of native hex functions, enlarge ip box for blockip a bit 2007-03-12 21:37:46 +00:00
Aaron Schulz
ac03a462ff * Add IPv6 support to XFF functions, improve IPv6 regexp 2007-03-12 18:15:58 +00:00
Aaron Schulz
c59a14f2cf *Use strval() to ensure wfBaseConvert() recieves a string 2007-03-12 07:44:19 +00:00
Aaron Schulz
26f2d0b1ea *Fix typos :( 2007-03-12 07:15:19 +00:00
Aaron Schulz
c1de6176c9 * Add IPv6 support 2007-03-12 07:01:27 +00:00
Aaron Schulz
a4c349a2df * Add isIPAddress() for IPs/networks, fix a bit bug 2007-03-12 06:06:32 +00:00
Aaron Schulz
489189d66f * Add IPv6 functions, fix explicit ranges 2007-03-12 02:43:26 +00:00
Nick Jenkins
784e69d028 For the "includes/" directory:
* removing unused local vars
* removing used global declarations
* adding FIXMEs against extract() calls and lines that seem to be using uninitialized variables
* adding some array() declarations.
2007-01-12 10:03:51 +00:00
Ævar Arnfjörð Bjarmason
dc80288f32 * 001.001.001.001 and other addresses with leading zeros are valid 2006-12-31 09:42:59 +00:00
Andrew Garrett
bafa087e99 Fix regression from r17927 that broke IP::isInRange (and hence the autoblock whitelist). 2006-12-08 10:30:50 +00:00
Nick Jenkins
ae8554c45b Completing code housekeeping stuff for rest of includes/ directory: removing unused local vars, removing unused globals, replacing extract() where simple to do, declaring output arrays before calling preg_match(), and so forth. 2006-11-29 11:43:58 +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
4ce2ae3eb1 2006-11-27 02:43:36 +00:00