]> git.mxchange.org Git - friendica.git/blobdiff - mod/item.php
Merge branch 'master', remote-tracking branch 'remotes/upstream/master'
[friendica.git] / mod / item.php
index 6b0a7996cf00f8ee19c1ce3b9951cc602280f506..642a6758aa0eaeabed7e8aecea015b544f570300 100644 (file)
@@ -272,8 +272,7 @@ function item_post(&$a) {
 
        $plaintext = (local_user() ? intval(get_pconfig(local_user(),'system','plaintext')) : 0);
        if((! $parent) && (! $api_source) && (! $plaintext)) {
-               $body = str_replace("\r\n","\n",$body);
-               $body = str_replace("\n\n","\n",$body);
+               $body = fix_mce_lf($body);
        }
 
 
@@ -351,7 +350,7 @@ function item_post(&$a) {
                                $image_uri = substr($image_uri,0, strpos($image_uri,'-'));
                                if(! strlen($image_uri))
                                        continue;
-                               $srch = '<' . intval($profile_uid) . '>';
+                               $srch = '<' . intval($contact_record['id']) . '>';
                                $r = q("SELECT `id` FROM `photo` WHERE `allow_cid` = '%s' AND `allow_gid` = '' AND `deny_cid` = '' AND `deny_gid` = ''
                                        AND `resource-id` = '%s' AND `uid` = %d LIMIT 1",
                                        dbesc($srch),
@@ -447,7 +446,7 @@ function item_post(&$a) {
 
        if(count($tags)) {
                foreach($tags as $tag) {
-                       handle_tag($a, $body, $inform, $str_tags, $profile_uid, $tag); 
+                       handle_tag($a, $body, $inform, $str_tags, (local_user()) ? local_user() : $profile_uid , $tag); 
                }
        }
 
@@ -760,7 +759,7 @@ function item_post(&$a) {
        }
        else {
                logger('mod_item: unable to retrieve post that was just stored.');
-               notify( t('System error. Post not saved.'));
+               notice( t('System error. Post not saved.') . EOL);
                goaway($a->get_baseurl() . "/" . $return_path );
                // NOTREACHED
        }
@@ -959,7 +958,6 @@ function handle_tag($a, &$body, &$inform, &$str_tags, $profile_uid, $tag) {
                                else
                                        $newname = $r[0]['name'];
                                //add person's id to $inform
-                               $inform_id = 'cid:' . $r[0]['id'];
                                if(strlen($inform))
                                        $inform .= ',';
                                $inform .= 'cid:' . $r[0]['id'];