mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 06:07:32 +02:00
Fixes #4389 - Fatal error on "Find Themes" lookup when no results returned.
This commit is contained in:
@@ -745,7 +745,7 @@ class e_marketplace_adapter_xmlrpc extends e_marketplace_adapter_abstract
|
|||||||
$this->prepareClient($method, $client);
|
$this->prepareClient($method, $client);
|
||||||
|
|
||||||
// authorization data
|
// authorization data
|
||||||
$data['auth'] = $this->getAuthKey();
|
// $data['auth'] = $this->getAuthKey();
|
||||||
$data['action'] = $method;
|
$data['action'] = $method;
|
||||||
|
|
||||||
foreach($data['params'] as $k=>$v)
|
foreach($data['params'] as $k=>$v)
|
||||||
@@ -831,18 +831,18 @@ class e_marketplace_adapter_xmlrpc extends e_marketplace_adapter_abstract
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* <key>
|
* <key>
|
||||||
* <value />
|
* <value />
|
||||||
* <value />
|
* <value />
|
||||||
* </key>
|
* </key>
|
||||||
*/
|
*/
|
||||||
if($tcount === 1 && $count > 1)
|
if($tcount === 1 && $count > 1)
|
||||||
{
|
{
|
||||||
foreach ($xml as $name => $node)
|
foreach($xml as $name => $node)
|
||||||
{
|
{
|
||||||
$_res = $this->parse($node, $name);
|
$_res = $this->parse($node, $name);
|
||||||
if(is_string($_res))
|
if(is_string($_res))
|
||||||
{
|
{
|
||||||
$_res = trim($_res);
|
$_res = trim($_res);
|
||||||
}
|
}
|
||||||
|
|
||||||
$ret[$name][] = $this->parse($node, $name);
|
$ret[$name][] = $this->parse($node, $name);
|
||||||
@@ -851,22 +851,40 @@ class e_marketplace_adapter_xmlrpc extends e_marketplace_adapter_abstract
|
|||||||
// default
|
// default
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach ($xml as $name => $node)
|
foreach($xml as $name => $node)
|
||||||
{
|
{
|
||||||
if(in_array($name, $this->_forceArray))
|
if(in_array($name, $this->_forceArray))
|
||||||
{
|
{
|
||||||
$_res = $this->parse($node, $name);
|
$_res = $this->parse($node, $name);
|
||||||
if(is_string($_res)) $_res = trim($_res);
|
if(is_string($_res))
|
||||||
|
{
|
||||||
|
$_res = trim($_res);
|
||||||
|
}
|
||||||
|
|
||||||
if(empty($_res)) $ret[$name] = array(); // empty
|
if(empty($_res))
|
||||||
elseif(is_string($_res)) $ret[$name][] = $_res; // string
|
{
|
||||||
|
$ret[$name] = array();
|
||||||
|
}
|
||||||
|
elseif(is_string($_res)) // empty
|
||||||
|
{
|
||||||
|
$ret[$name][] = $_res;
|
||||||
|
} // string
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(in_array($name, $this->_forceNumericalArray)) $ret[$name][] = $_res; //array - controlled force numerical array
|
if(in_array($name, $this->_forceNumericalArray))
|
||||||
else $ret[$name] = $_res; //array, no force
|
{
|
||||||
|
$ret[$name][] = $_res;
|
||||||
|
} //array - controlled force numerical array
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$ret[$name] = $_res;
|
||||||
|
} //array, no force
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else $ret[$name] = $this->parse($node, $name);
|
else
|
||||||
|
{
|
||||||
|
$ret[$name] = $this->parse($node, $name);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -923,7 +941,7 @@ class e_marketplace_adapter_xmlrpc extends e_marketplace_adapter_abstract
|
|||||||
switch ($method)
|
switch ($method)
|
||||||
{
|
{
|
||||||
case 'getList':
|
case 'getList':
|
||||||
$this->_forceArray = array('item', 'screenshots', 'image');
|
$this->_forceArray = array('item', 'screenshots', 'image', 'data');
|
||||||
$this->_forceNumericalArray = array('item', 'image');
|
$this->_forceNumericalArray = array('item', 'image');
|
||||||
//$client->setOptArrayTags('item,screenshots,image')
|
//$client->setOptArrayTags('item,screenshots,image')
|
||||||
// ->setOptStringTags('icon,folder,version,author,authorURL,date,compatibility,url,thumbnail,featured,livedemo,price,name,description,category,image');
|
// ->setOptStringTags('icon,folder,version,author,authorURL,date,compatibility,url,thumbnail,featured,livedemo,price,name,description,category,image');
|
||||||
|
Reference in New Issue
Block a user