Code Duplication    Length = 12-12 lines in 2 locations

request.php 1 location

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

submit.php 1 location

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