private function check_presence($uri, $item_id = NULL) { $uri = Alias::sanitize($uri); $item_cond = $item_id !== NULL ? 'AND item_id != ' . (int) $item_id : ''; $sql = 'SELECT DISTINCT alias_id FROM ' . ALIASES_TABLE . ' WHERE uri = "' . $uri . '" ' . $item_cond; $result = db_query($sql); return (bool) db_num_rows($result['resource']); }