mirror of
https://github.com/friendica/friendica
synced 2025-04-25 23:10:12 +00:00
Restructured "dba::exists" function
This commit is contained in:
parent
b14b44e8a8
commit
1d8c91c478
9 changed files with 33 additions and 35 deletions
|
@ -488,8 +488,6 @@ if (! function_exists('item_new_uri')) {
|
|||
function item_new_uri($hostname, $uid, $guid = "") {
|
||||
|
||||
do {
|
||||
$dups = false;
|
||||
|
||||
if ($guid == "") {
|
||||
$hash = get_guid(32);
|
||||
} else {
|
||||
|
@ -499,10 +497,7 @@ function item_new_uri($hostname, $uid, $guid = "") {
|
|||
|
||||
$uri = "urn:X-dfrn:" . $hostname . ':' . $uid . ':' . $hash;
|
||||
|
||||
$r = dba::select('item', array('id'), array('uri' => $uri), array('limit' => 1));
|
||||
if (dbm::is_result($r)) {
|
||||
$dups = true;
|
||||
}
|
||||
$dups = dba::exists('item', array('uri' => $uri));
|
||||
} while ($dups == true);
|
||||
|
||||
return $uri;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue