]> git.mxchange.org Git - friendica.git/blobdiff - mod/share.php
Normalize App parameter declaration (mod folder, 3 out of 3)
[friendica.git] / mod / share.php
index f3a221eb8ef4c985f9b8ad9e86a523efb8a4fa61..928ccdef263efc45b7f24f66c6c8c123f945888a 100644 (file)
@@ -1,7 +1,5 @@
 <?php
-
-if(! function_exists('share_init')) {
-function share_init(&$a) {
+function share_init(App $a) {
 
        $post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
        if((! $post_id) || (! local_user()))
@@ -14,7 +12,7 @@ function share_init(&$a) {
                intval($post_id),
                intval(local_user())
        );
-       if(! count($r) || ($r[0]['private'] == 1))
+       if(! dbm::is_result($r) || ($r[0]['private'] == 1))
                killme();
 
        if (!intval(get_config('system','old_share'))) {
@@ -42,9 +40,7 @@ function share_init(&$a) {
        echo $o;
        killme();
 }
-}
 
-if(! function_exists('share_header')) {
 function share_header($author, $profile, $avatar, $guid, $posted, $link) {
        $header = "[share author='".str_replace(array("'", "[", "]"), array("&#x27;", "&#x5B;", "&#x5D;"),$author).
                "' profile='".str_replace(array("'", "[", "]"), array("&#x27;", "&#x5B;", "&#x5D;"),$profile).
@@ -60,4 +56,3 @@ function share_header($author, $profile, $avatar, $guid, $posted, $link) {
 
        return $header;
 }
-}