From: Michael Vogel <icarus@dabo.de>
Date: Wed, 12 Aug 2015 21:37:50 +0000 (+0200)
Subject: Diaspora now uses a 32 digit guid.
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=bb7ec55f1f174e80148132c8f8842bf8107ccaeb;p=friendica.git

Diaspora now uses a 32 digit guid.
---

diff --git a/include/text.php b/include/text.php
index 58da443c2f..18ce232f1d 100644
--- a/include/text.php
+++ b/include/text.php
@@ -1788,7 +1788,7 @@ function return_bytes ($size_str) {
 function generate_user_guid() {
 	$found = true;
 	do {
-		$guid = random_string(16);
+		$guid = get_guid(32);
 		$x = q("SELECT `uid` FROM `user` WHERE `guid` = '%s' LIMIT 1",
 			dbesc($guid)
 		);
diff --git a/include/uimport.php b/include/uimport.php
index b8439ee094..78471af151 100644
--- a/include/uimport.php
+++ b/include/uimport.php
@@ -157,7 +157,8 @@ function import_account(&$a, $file) {
 	//~ $newuid = 1;
 
 	// Generate a new guid for the account. Otherwise there will be problems with diaspora
-	q("UPDATE `user` SET `guid` = '%s' WHERE `uid` = %d", generate_user_guid(), $newuid);
+	q("UPDATE `user` SET `guid` = '%s' WHERE `uid` = %d",
+		dbesc(generate_user_guid()), intval($newuid));
 
 	foreach ($account['profile'] as &$profile) {
 		foreach ($profile as $k => &$v) {