item uuid changes
This commit is contained in:
@@ -574,18 +574,9 @@ function alt_pager($i, $more = '', $less = '') {
|
||||
* @return string a unique id
|
||||
*/
|
||||
function item_message_id() {
|
||||
do {
|
||||
$dups = false;
|
||||
$hash = random_string();
|
||||
$mid = $hash . '@' . App::get_hostname();
|
||||
|
||||
$r = q("SELECT id FROM item WHERE mid = '%s' LIMIT 1",
|
||||
dbesc($mid));
|
||||
if($r)
|
||||
$dups = true;
|
||||
} while($dups == true);
|
||||
return new_uuid();
|
||||
|
||||
return $mid;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -596,17 +587,9 @@ function item_message_id() {
|
||||
* @return string a uniqe hash
|
||||
*/
|
||||
function photo_new_resource() {
|
||||
do {
|
||||
$found = false;
|
||||
$resource = hash('md5', uniqid(mt_rand(), true));
|
||||
|
||||
$r = q("SELECT id FROM photo WHERE resource_id = '%s' LIMIT 1",
|
||||
dbesc($resource));
|
||||
if($r)
|
||||
$found = true;
|
||||
} while($found === true);
|
||||
return new_uuid();
|
||||
|
||||
return $resource;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user