eesyphp/includes/url-helpers.php

16 lines
327 B
PHP
Raw Normal View History

2020-04-18 00:51:33 +02:00
<?php
function get_item_from_url($id, $fatal=false) {
if (!check_id($id))
logging('FATAL', "Identifiant d'élément invalide.");
$item = get_item($id);
if(!is_array($item)) {
if ($fatal)
logging('FATAL', "Élément #$id introuvable.");
add_error("Élement #$id introuvable.");
return false;
}
return $item;
}