diff options
author | Friendika <info@friendika.com> | 2011-08-07 16:56:26 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-08-07 16:56:26 -0700 |
commit | 1eec10329a4764f132b159e7b1bbf37added6c8a (patch) | |
tree | 545c9a280fc5fc6d62f7adfa15e76fb8364c5ecc /boot.php | |
parent | eea493d1f575871f89ede359a9a216ff4c39ea53 (diff) | |
download | volse-hubzilla-1eec10329a4764f132b159e7b1bbf37added6c8a.tar.gz volse-hubzilla-1eec10329a4764f132b159e7b1bbf37added6c8a.tar.bz2 volse-hubzilla-1eec10329a4764f132b159e7b1bbf37added6c8a.zip |
guid functions
Diffstat (limited to 'boot.php')
-rw-r--r-- | boot.php | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -610,12 +610,12 @@ function check_config(&$a) { }} -function get_guid() { - $exists = true; +function get_guid($size=16) { + $exists = true; // assume by default that we don't have a unique guid do { - $s = random_string(16); + $s = random_string($size); $r = q("select id from guid where guid = '%s' limit 1", dbesc($s)); - if(! results($r)) + if(! count($r)) $exists = false; } while($exists); q("insert into guid ( guid ) values ( '%s' ) ", dbesc($s)); |