]> git.mxchange.org Git - friendica.git/commitdiff
Don't generate a guid shorter than 13 characters
authorMichael Vogel <icarus@dabo.de>
Wed, 16 Dec 2015 09:47:26 +0000 (10:47 +0100)
committerMichael Vogel <icarus@dabo.de>
Wed, 16 Dec 2015 09:47:26 +0000 (10:47 +0100)
boot.php

index 19cfd71a8aad7343b499983c1bb0b39064de9fa1..9f7a1b2f2e1de77da47521a340cab3ac5448f5c5 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -1248,7 +1248,7 @@ function get_guid($size=16, $prefix = "") {
                $prefix = substr($prefix, 0, $size - 22);
                return(str_replace(".", "", uniqid($prefix, true)));
        } else {
-               $prefix = substr($prefix, 0, $size - 13);
+               $prefix = substr($prefix, 0, max($size - 13, 0));
                return(uniqid($prefix));
        }
 }