Update of /cvsroot/phpweather/phpweather
In directory usw-pr-cvs1:/tmp/cvs-serv1233
Modified Files:
phpweather.php
Log Message:
Extra check to ensure consistency in the decoded METAR. The problem
was METARs like this one:
EGBE 260820Z 0200KT 340V060 CAVOK 06/02 Q1033
This METAR has a malformed wind-group: '0200KT 340V060', but the last
part of it would be parsed correctly. So there would be information
about variable wind-direction, but no information about the speed.
Index: phpweather.php
===================================================================
RCS file: /cvsroot/phpweather/phpweather/phpweather.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- phpweather.php 25 Mar 2002 20:26:33 -0000 1.19
+++ phpweather.php 26 Mar 2002 16:29:32 -0000 1.20
@@ -256,7 +256,8 @@
$decoded_metar['wind']['gust_meters_per_second'],
$decoded_metar['wind']['gust_miles_per_hour']);
}
- } elseif (ereg('^([0-9]{3})V([0-9]{3})$', $part, $regs)) {
+ } elseif (ereg('^([0-9]{3})V([0-9]{3})$', $part, $regs) &&
+ !empty($decoded_metar['wind'])) {
/*
* Variable wind-direction
|