From 1020bf46ae33bb0dc552ad77d0e9a42fce8e337b Mon Sep 17 00:00:00 2001
From: Jacek Kowalski <Jacek@jacekk.info>
Date: Sun, 06 Jul 2014 21:49:10 +0000
Subject: [PATCH] [mod_data] Poprawienie możliwości wyświetlenia błędnego numeru roku w dacie

---
 modules/30_pogoda/api_geonames.php |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modules/30_pogoda/api_geonames.php b/modules/30_pogoda/api_geonames.php
index f551426..39c488e 100644
--- a/modules/30_pogoda/api_geonames.php
+++ b/modules/30_pogoda/api_geonames.php
@@ -26,7 +26,7 @@
 			// Trzymaj w cache przez około 116 dni
 			$download->cacheFor(10000000);
 			
-			if($data->geoname[0]->getName() != 'geoname'
+			if((int)$data->totalResultsCount == 0 || $data->geoname->getName() != 'geoname' || $data->geoname[0]->getName() != 'geoname'
 				|| $data->geoname[0]->name->getName() != 'name'
 				|| $data->geoname[0]->countryName->getName() != 'countryName'
 				|| $data->geoname[0]->lat->getName() != 'lat'

--
Gitblit v1.9.1