diff options
author | zotlabs <mike@macgirvin.com> | 2018-11-12 18:25:55 -0800 |
---|---|---|
committer | zotlabs <mike@macgirvin.com> | 2018-11-12 18:25:55 -0800 |
commit | 1a2df9c51c4692fce433f483aba1b91738609df7 (patch) | |
tree | 2d62c4369e621b24b0f6047c62aca1599042f6a9 /include/text.php | |
parent | 770fdb2b7d095d763d43ffe8d2f6b5b2182673cb (diff) | |
download | volse-hubzilla-1a2df9c51c4692fce433f483aba1b91738609df7.tar.gz volse-hubzilla-1a2df9c51c4692fce433f483aba1b91738609df7.tar.bz2 volse-hubzilla-1a2df9c51c4692fce433f483aba1b91738609df7.zip |
item uuid changes
Diffstat (limited to 'include/text.php')
-rw-r--r-- | include/text.php | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/include/text.php b/include/text.php index 3d351f7dc..d3130023c 100644 --- a/include/text.php +++ b/include/text.php @@ -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; } /** |