Index: trunk/extensions/GeoData/tests/TagTest.php |
— | — | @@ -39,6 +39,14 @@ |
40 | 40 | '{{#coordinates: primary|10|20}}', |
41 | 41 | array( 'lat' => 10, 'lon' => 20, 'globe' => 'earth', 'primary' => true ), |
42 | 42 | ), |
| 43 | + array( |
| 44 | + '{{#coordinates: 10|20|type:city}}', |
| 45 | + array( 'lat' => 10, 'lon' => 20, 'globe' => 'earth', 'type' => 'city' ), |
| 46 | + ), |
| 47 | + array( |
| 48 | + '{{#coordinates: 10|20|type:city(666)}}', |
| 49 | + array( 'lat' => 10, 'lon' => 20, 'globe' => 'earth', 'type' => 'city' ), |
| 50 | + ), |
43 | 51 | array( |
44 | 52 | '{{#coordinates:10|20|globe:Moon dim:10_region:RU-mos}}', |
45 | 53 | array( 'lat' => 10, 'lon' => 20, 'globe' => 'moon', 'country' => 'RU', 'region' => 'MOS' ), |
Index: trunk/extensions/GeoData/CoordinatesParserFunction.php |
— | — | @@ -144,7 +144,9 @@ |
145 | 145 | $coord->dim = $dim; |
146 | 146 | } |
147 | 147 | } |
148 | | - $coord->type = isset( $args['type'] ) ? $args['type'] : null; |
| 148 | + if ( isset( $args['type'] ) ) { |
| 149 | + $coord->type = preg_replace( '/\(.*?\).*$/', '', $args['type'] ); |
| 150 | + } |
149 | 151 | $coord->name = isset( $args['name'] ) ? $args['name'] : null; |
150 | 152 | if ( isset( $args['region'] ) ) { |
151 | 153 | $code = strtoupper( $args['region'] ); |