From 371cfdb520a44b85cc041709a067ee1046f8acd0 Mon Sep 17 00:00:00 2001 From: daeks Date: Mon, 23 Sep 2013 17:18:52 +0200 Subject: [PATCH] quick fix --- components/market/class.market.php | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/components/market/class.market.php b/components/market/class.market.php index 4d75313..a0b3220 100644 --- a/components/market/class.market.php +++ b/components/market/class.market.php @@ -71,17 +71,6 @@ class Market extends Common { // check old cache for new ones $this->tmp = array(); foreach($this->remote as $key=>$data) { - $found = false; - foreach($this->old as $key=>$old) { - if($old['name'] == $data['name']) { - $found = true; - break; - } - } - if(!$found && !isset($data['folder'])) { - $data['new'] = '1'; - } - // check if folder exists for that extension if(substr($data['url'],-4) == '.git') { $data['url'] = substr($data['url'],0,-4); @@ -93,7 +82,19 @@ class Market extends Common { $data['folder'] = substr($data['url'],strrpos($data['url'],'/')+1).'-master'; } } - + + // check if new plugin already exists in local cache + $found = false; + foreach($this->old as $key=>$old) { + if($old['name'] == $data['name']) { + $found = true; + break; + } + } + if(!$found && !isset($data['folder'])) { + $data['new'] = '1'; + } + array_push($this->tmp, $data); } $this->remote = $this->tmp;