Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F5129
IPparseRange.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Authored By
•
bzimport
Nov 21 2014, 10:19 PM
2014-11-21 22:19:41 (UTC+0)
Size
905 B
Referenced Files
None
Subscribers
None
IPparseRange.patch
View Options
Index: includes/IP.php
===================================================================
--- includes/IP.php (revision 38663)
+++ includes/IP.php (working copy)
@@ -426,12 +426,16 @@
} elseif ( strpos( $range, '-' ) !== false ) {
# Explicit range
list( $start, $end ) = array_map( 'trim', explode( '-', $range, 2 ) );
- $start = self::toUnsigned( $start ); $end = self::toUnsigned( $end );
- if ( $start > $end ) {
+ if( self::isIPAddress( $start ) && self::isIPAddress( $end ) ) {
+ $start = self::toUnsigned( $start ); $end = self::toUnsigned( $end );
+ if ( $start > $end ) {
+ $start = $end = false;
+ } else {
+ $start = sprintf( '%08X', $start );
+ $end = sprintf( '%08X', $end );
+ }
+ } else {
$start = $end = false;
- } else {
- $start = sprintf( '%08X', $start );
- $end = sprintf( '%08X', $end );
}
} else {
# Single IP
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4692
Default Alt Text
IPparseRange.patch (905 B)
Attached To
Mode
T17049: searching CU log for usernames with a hyphen gives unspecific results
Attached
Detach File
Event Timeline
Log In to Comment