forked from Wavyzz/dolibarr
fix phpstan
This commit is contained in:
@@ -52,9 +52,15 @@ $search = GETPOST('search', 'restricthtml');
|
|||||||
$page = GETPOSTINT('page');
|
$page = GETPOSTINT('page');
|
||||||
$limit = 10;
|
$limit = 10;
|
||||||
$offset = (($page - 1) * $limit);
|
$offset = (($page - 1) * $limit);
|
||||||
|
$element_ref = '';
|
||||||
|
if (is_numeric($id)) {
|
||||||
|
$id = (int) $id;
|
||||||
|
} else {
|
||||||
|
$element_ref = $id;
|
||||||
|
$id = 0;
|
||||||
|
}
|
||||||
// Load object according to $element
|
// Load object according to $element
|
||||||
$object = fetchObjectByElement($id, $objecttype);
|
$object = fetchObjectByElement($id, $objecttype, $element_ref);
|
||||||
if (empty($object->element)) {
|
if (empty($object->element)) {
|
||||||
httponly_accessforbidden('Failed to get object with fetchObjectByElement(id=' . $id . ', objecttype=' . $objecttype . ')');
|
httponly_accessforbidden('Failed to get object with fetchObjectByElement(id=' . $id . ', objecttype=' . $objecttype . ')');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user