]> git.mxchange.org Git - friendica.git/commitdiff
url_from_contact_guid: move network constant to arg list
authorHypolite Petovan <ben.lort@gmail.com>
Wed, 21 Dec 2016 01:52:42 +0000 (20:52 -0500)
committerHypolite Petovan <ben.lort@gmail.com>
Wed, 21 Dec 2016 01:52:42 +0000 (20:52 -0500)
include/diaspora.php

index db49441a03164fb02c33dff8be386d3a5052c7e4..2547de5149b9354eb6b522831cdf2710702f35cd 100644 (file)
@@ -714,8 +714,10 @@ class Diaspora {
        public static function url_from_contact_guid($fcontact_guid) {
                logger("fcontact guid is ".$fcontact_guid, LOGGER_DEBUG);
 
-               $r = q("SELECT `url` FROM `fcontact` WHERE `guid` = '%s' AND `network` = '" . NETWORK_DIASPORA . "' AND `url` != ''",
-                       $fcontact_guid);
+               $r = q("SELECT `url` FROM `fcontact` WHERE `url` != '' AND `network` = '%s' AND `guid` = '%s'",
+                       dbesc(NETWORK_DIASPORA),
+                       dbesc($fcontact_guid)
+               );
 
                if (dbm::is_result($r)) {
                        return $r[0]['url'];