Code Duplication    Length = 6-6 lines in 2 locations

message_ajax.php 2 locations

@@ 68-73 (lines=6) @@
65
        if ($insdata) {
66
           //$updatesarray = $wall->Updates('a', $id, $followers,$page);
67
            foreach ($insdata as $data) {
68
                if ($helper->isUserAdmin() || $data['uid_fk'] == $id) {
69
                    $USW = ['posts' => 1, 'comments' => 1];
70
                } else {
71
                    $USW = ['posts' => 0, 'comments' => 0];
72
                    $USW = json_decode($swDB->getSettings($data['uid_fk']), true);
73
                }
74
75
                $wm['msg_id']          = $data['msg_id'];
76
                $wm['orimessage']      = (1 == $USW['posts'] || $profile >= Constants::PROFILE_HAS_BOTH) ? str_replace(["\r", "\n"], '', smallworld_stripWordsKeepUrl($data['message'])) : '';
@@ 113-118 (lines=6) @@
110
                $tpl->append('walldata', $wm);
111
112
                foreach ($wm['commentsarray'] as $cdata) {
113
                    if ($helper->isUserAdmin() && $cdata['uid_fk'] == $id) {
114
                        $USC = ['posts' => 1, 'comments' => 1];
115
                    } else {
116
                        $USC = ['posts' => 0, 'comments' => 0];
117
                        $USC = json_decode($swDB->getSettings($cdata['uid_fk']), true);
118
                    }
119
120
                    $wc['msg_id_fk']       = $cdata['msg_id_fk'];
121
                    $wc['com_id']          = $cdata['com_id'];