Code Duplication    Length = 12-12 lines in 2 locations

request.php 1 location

@@ 88-99 (lines=12) @@
85
            $newFaqObj->sendNotifications(array(_SF_NOT_QUESTION_PUBLISHED));
86
87
            $redirect_msg = _MD_SF_REQUEST_RECEIVED_AND_PUBLISHED;
88
        } else {
89
            // Subscribe the user to On Published notification, if requested
90
            if ($notifypub == 1) {
91
                include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
92
                $notificationHandler = xoops_getHandler('notification');
93
                $notificationHandler->subscribe('question', $newFaqObj->faqid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
94
            }
95
            // Send notifications
96
            $newFaqObj->sendNotifications(array(_SF_NOT_QUESTION_SUBMITTED));
97
98
            $redirect_msg = _MD_SF_REQUEST_RECEIVED_NEED_APPROVAL;
99
        }
100
101
        //redirect_header("javascript:history.go(-2)", 3, $redirect_msg);
102
        redirect_header('index.php', 2, $redirect_msg);

submit.php 1 location

@@ 247-258 (lines=12) @@
244
            $newFaqObj->sendNotifications(array(_SF_NOT_FAQ_PUBLISHED));
245
246
            $redirect_msg = _MD_SF_QNA_RECEIVED_AND_PUBLISHED;
247
        } else {
248
            // Subscribe the user to On Published notification, if requested
249
            if ($notifypub == 1) {
250
                include_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
251
                $notificationHandler = xoops_getHandler('notification');
252
                $notificationHandler->subscribe('faq', $newFaqObj->faqid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
253
            }
254
            // Send notifications
255
            $newFaqObj->sendNotifications(array(_SF_NOT_FAQ_SUBMITTED));
256
257
            $redirect_msg = _MD_SF_QNA_RECEIVED_NEED_APPROVAL;
258
        }
259
260
        redirect_header('index.php', 2, $redirect_msg);
261
        break;