For unique values we should use our guid function - not the random function

This commit is contained in:
Michael Vogel
2015-08-14 00:40:36 +02:00
parent 4663df5b2b
commit a2d742ec91
3 changed files with 10 additions and 4 deletions

View File

@@ -470,11 +470,17 @@ if(! function_exists('item_new_uri')) {
* @param int $uid
* @return string
*/
function item_new_uri($hostname,$uid) {
function item_new_uri($hostname,$uid, $guid = "") {
do {
$dups = false;
$hash = random_string();
if ($guid == "")
$hash = get_guid(32);
else {
$hash = $guid;
$guid = "";
}
$uri = "urn:X-dfrn:" . $hostname . ':' . $uid . ':' . $hash;