r85436 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85435‎ | r85436 | r85437 >
Date:14:08, 5 April 2011
Author:demon
Status:ok
Tags:
Comment:
MFT r82093, r82095 (dunno why they didn't merge cleanly before...)
Modified paths:
  • /branches/REL1_17/phase3/includes/IP.php (modified) (history)

Diff [purge]

Index: branches/REL1_17/phase3/includes/IP.php
@@ -39,17 +39,18 @@
4040 ':(?::|(?::' . RE_IPV6_WORD . '){1,7})' .
4141 '|' . // ends with "::" (except "::")
4242 RE_IPV6_WORD . '(?::' . RE_IPV6_WORD . '){0,6}::' .
43 - '|' . // contains no "::"
44 - RE_IPV6_WORD . '(?::' . RE_IPV6_WORD . '){7}' .
45 - '|' . // contains one "::" in the middle and 2 words
46 - RE_IPV6_WORD . '::' . RE_IPV6_WORD .
47 - '|' . // contains one "::" in the middle and 3+ words (awkward regex for PCRE 4.0+)
 43+ '|' . // contains one "::" in the middle, ending in "::WORD"
 44+ RE_IPV6_WORD . '(?::' . RE_IPV6_WORD . '){0,5}' . '::' . RE_IPV6_WORD .
 45+ '|' . // contains one "::" in the middle, not ending in "::WORD" (regex for PCRE 4.0+)
4846 RE_IPV6_WORD . '(?::(?P<abn>:(?P<iabn>))?' . RE_IPV6_WORD . '(?!:(?P=abn))){1,5}' .
4947 ':' . RE_IPV6_WORD . '(?P=iabn)' .
5048 // NOTE: (?!(?P=abn)) fails iff "::" used twice; (?P=iabn) passes iff a "::" was found.
51 - // RegExp (PCRE 7.2+ only) for last 2 cases that allows easy regex concatenation:
52 - #RE_IPV6_WORD . '(?::((?(-1)|:))?' . RE_IPV6_WORD . '){1,6}(?(-2)|^)' .
 49+ '|' . // contains no "::"
 50+ RE_IPV6_WORD . '(?::' . RE_IPV6_WORD . '){7}' .
5351 ')'
 52+ // NOTE: With PCRE 7.2+, we can combine the two '"::" in the middle' cases into:
 53+ // RE_IPV6_WORD . '(?::((?(-1)|:))?' . RE_IPV6_WORD . '){1,6}(?(-2)|^)'
 54+ // This also improves regex concatenation by using relative references.
5455 );
5556 // An IPv6 block is an IP address and a prefix (d1 to d128)
5657 define( 'RE_IPV6_BLOCK', RE_IPV6_ADD . '\/' . RE_IPV6_PREFIX );
Property changes on: branches/REL1_17/phase3/includes/IP.php
___________________________________________________________________
Added: svn:mergeinfo
5758 Merged /branches/new-installer/phase3/includes/IP.php:r43664-66004
5859 Merged /branches/wmf-deployment/includes/IP.php:r53381
5960 Merged /branches/REL1_15/phase3/includes/IP.php:r51646
6061 Merged /branches/sqlite/includes/IP.php:r58211-58321
6162 Merged /trunk/phase3/includes/IP.php:r82093,82095,82474,82845,82847-82848

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r82093* (bug 27353) IPv6 address ending in "::WORD" was not recognized...aaron23:24, 13 February 2011
r82095Follow-up r82093: fixed comment :)aaron23:30, 13 February 2011

Status & tagging log