cvs: pear /Services_Weather/Weather Metar.php

From: Date: Thu, 13 Oct 2005 07:56:44 +0000
Subject: cvs: pear /Services_Weather/Weather Metar.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-35487@lists.php.net to get a copy of this message
eru Thu Oct 13 03:56:44 2005 EDT Modified files: /pear/Services_Weather/Weather Metar.php Log: Added error-checking for faulty locations in getWeather/getForecast http://cvs.php.net/diff.php/pear/Services_Weather/Weather/Metar.php?r1=1.69&r2=1.70&ty=u Index: pear/Services_Weather/Weather/Metar.php diff -u pear/Services_Weather/Weather/Metar.php:1.69 pear/Services_Weather/Weather/Metar.php:1.70 --- pear/Services_Weather/Weather/Metar.php:1.69 Wed Oct 12 12:18:17 2005 +++ pear/Services_Weather/Weather/Metar.php Thu Oct 13 03:56:37 2005 @@ -16,7 +16,7 @@ // | Authors: Alexander Wirtz <alex@pc4p.net> | // +----------------------------------------------------------------------+ // -// $Id: Metar.php,v 1.69 2005/10/12 16:18:17 eru Exp $ +// $Id: Metar.php,v 1.70 2005/10/13 07:56:37 eru Exp $ /** * @package Services_Weather @@ -1565,6 +1565,10 @@ $units = $this->getUnitsFormat($unitsFormat); $location = $this->getLocation($id); + if (Services_Weather::isError($location)) { + return $location; + } + if ($this->_cacheEnabled && ($weather = $this->_cache->get("METAR-".$id, "weather"))) { // Wee... it was cached, let's have it... $weatherReturn = $weather; @@ -1624,6 +1628,10 @@ $units = $this->getUnitsFormat($unitsFormat); $location = $this->getLocation($id); + if (Services_Weather::isError($location)) { + return $location; + } + if ($this->_cacheEnabled && ($forecast = $this->_cache->get("METAR-".$id, "forecast"))) { // Wee... it was cached, let's have it... $forecastReturn = $forecast;

« previous php.pear.cvs (#35487) next »