Skip to content

Commit

Permalink
Issue #2 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtProg committed Nov 12, 2018
1 parent 89241ea commit 35b1d95
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions model/gitmodx/gitmodx.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,24 @@ public function getCount($className, $criteria = null){
{
case 'modChunk':
case 'modSnippet':
if(!isset($criteria['name'])){
foreach($criteria as $key => $value){
if(preg_match('#:?name:?#i',$key))
{
$criteria['name'] = $value;
break;
if(is_array($criteria)){
if(!isset($criteria['name'])){
foreach($criteria as $key => $value){
if(preg_match('#:?name:?#i',$key))
{
$criteria['name'] = $value;
break;
}
}
if(!isset($criteria['name'])) break;
}
if(!isset($criteria['name'])) break;
}

if($this->getParser())
{
if($element = $this->parser->getElementFromFile($className,$criteria['name']))
if($this->getParser())
{
return 1;
if($element = $this->parser->getElementFromFile($className,$criteria['name']))
{
return 1;
}
}
}
break;
Expand Down

0 comments on commit 35b1d95

Please sign in to comment.