r72994 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72993‎ | r72994 | r72995 >
Date:17:09, 14 September 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Increased max decimals in DMS seconds from 2 to 20
Modified paths:
  • /trunk/extensions/Maps/includes/Maps_CoordinateParser.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Maps/includes/Maps_CoordinateParser.php
@@ -314,10 +314,10 @@
315315 */
316316 public static function areDMSCoordinates( $coordinates ) {
317317 $sep = self::getSeparatorsRegex();
318 - return preg_match( '/^(-)?(\d{1,3}°)(\d{1,2}(\′|\'))?((\d{1,2}(″|"))?|(\d{1,2}\.\d{1,2}(″|"))?)'
319 - . $sep . '(-)?(\d{1,3}°)(\d{1,2}(\′|\'))?((\d{1,2}(″|"))?|(\d{1,2}\.\d{1,2}(″|"))?)$/i', $coordinates ) // Non-directional
320 - || preg_match( '/^(\d{1,3}°)(\d{1,2}(\′|\'))?((\d{1,2}(″|"))?|(\d{1,2}\.\d{1,2}(″|"))?)(N|S)'
321 - . $sep . '(\d{1,3}°)(\d{1,2}(\′|\'))?((\d{1,2}(″|"))?|(\d{1,2}\.\d{1,2}(″|"))?)(E|W)$/i', $coordinates ); // Directional
 318+ return preg_match( '/^(-)?(\d{1,3}°)(\d{1,2}(\′|\'))?((\d{1,2}(″|"))?|(\d{1,2}\.\d{1,20}(″|"))?)'
 319+ . $sep . '(-)?(\d{1,3}°)(\d{1,2}(\′|\'))?((\d{1,2}(″|"))?|(\d{1,2}\.\d{1,20}(″|"))?)$/i', $coordinates ) // Non-directional
 320+ || preg_match( '/^(\d{1,3}°)(\d{1,2}(\′|\'))?((\d{1,2}(″|"))?|(\d{1,2}\.\d{1,20}(″|"))?)(N|S)'
 321+ . $sep . '(\d{1,3}°)(\d{1,2}(\′|\'))?((\d{1,2}(″|"))?|(\d{1,2}\.\d{1,20}(″|"))?)(E|W)$/i', $coordinates ); // Directional
322322 }
323323
324324 /**

Status & tagging log