eesyphp/includes/url-helpers.php
Benjamin Renard efc7352404 Code cleaning
2022-04-24 17:43:44 +02:00

17 lines
349 B
PHP

<?php
function get_item_from_url($id, $fatal=false) {
if (!check_id($id))
logging('FATAL', _('Invalid element identifier.'));
$item = get_item($id);
if(!is_array($item)) {
$error = sprintf(_("Item #% s not found."), $id);
if ($fatal)
logging('FATAL', $error);
add_error($error);
return false;
}
return $item;
}