]> git.mxchange.org Git - friendica.git/commitdiff
Misc changes to url_from_contact_guid
authorHypolite Petovan <mrpetovan@gmail.com>
Tue, 20 Dec 2016 19:33:33 +0000 (14:33 -0500)
committerHypolite Petovan <mrpetovan@gmail.com>
Tue, 20 Dec 2016 19:33:33 +0000 (14:33 -0500)
- Rename url_from_fcontact_guid to url_from_fcontact_guid
- Use network name constant
- Standards

include/diaspora.php

index 4af1b6daa171ac637cae9cf9e0e02d2bb8ef7b59..db49441a03164fb02c33dff8be386d3a5052c7e4 100644 (file)
@@ -711,10 +711,10 @@ class Diaspora {
         *
         * @return string the contact url or null
         */
-       public static function url_from_fcontact_guid($fcontact_guid) {
+       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` = 'dspr' AND `url` != ''",
+               $r = q("SELECT `url` FROM `fcontact` WHERE `guid` = '%s' AND `network` = '" . NETWORK_DIASPORA . "' AND `url` != ''",
                        $fcontact_guid);
 
                if (dbm::is_result($r)) {
@@ -866,11 +866,11 @@ class Diaspora {
                                // 0 => '[url=/people/0123456789abcdef]Foo Bar[/url]'
                                // 1 => '0123456789abcdef'
                                // 2 => 'Foo Bar'
-                               $handle = self::url_from_fcontact_guid($match[1]);
+                               $handle = self::url_from_contact_guid($match[1]);
 
                                if ($handle) {
                                        $return = '@[url='.$handle.']'.$match[2].'[/url]';
-                               }else {
+                               } else {
                                        // No local match, restoring absolute remote URL from author scheme and host
                                        $author_url = parse_url($author_link);
                                        $return = '[url='.$author_url['scheme'].'://'.$author_url['host'].'/people/'.$match[1].']'.$match[2].'[/url]';