Error when fetching empty expression

This commit is contained in:
Ion 2017-03-06 20:56:40 +01:00
parent e95ee4b878
commit cb463d186a

View File

@ -121,6 +121,13 @@ class PriceExpression
*/
function fetch($id)
{
// Check parameters
if (empty($id))
{
$this->error='ErrorWrongParameters';
return -1;
}
$sql = "SELECT title, expression";
$sql.= " FROM ".MAIN_DB_PREFIX.$this->table_element;
$sql.= " WHERE rowid = ".$id;