Code Duplication    Length = 12-12 lines in 2 locations

request.php 1 location

@@ 96-107 (lines=12) @@
93
            $newFaqObj->sendNotifications([Constants::SF_NOT_QUESTION_PUBLISHED]);
94
95
            $redirect_msg = _MD_SF_REQUEST_RECEIVED_AND_PUBLISHED;
96
        } else {
97
            // Subscribe the user to On Published notification, if requested
98
            if (1 == $notifypub) {
99
                require_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
100
                $notificationHandler = xoops_getHandler('notification');
101
                $notificationHandler->subscribe('question', $newFaqObj->faqid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
102
            }
103
            // Send notifications
104
            $newFaqObj->sendNotifications([Constants::SF_NOT_QUESTION_SUBMITTED]);
105
106
            $redirect_msg = _MD_SF_REQUEST_RECEIVED_NEED_APPROVAL;
107
        }
108
109
        //redirect_header("javascript:history.go(-2)", 3, $redirect_msg);
110
        redirect_header('index.php', 2, $redirect_msg);

submit.php 1 location

@@ 258-269 (lines=12) @@
255
            $newFaqObj->sendNotifications([Constants::SF_NOT_FAQ_PUBLISHED]);
256
257
            $redirect_msg = _MD_SF_QNA_RECEIVED_AND_PUBLISHED;
258
        } else {
259
            // Subscribe the user to On Published notification, if requested
260
            if (1 == $notifypub) {
261
                require_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
262
                $notificationHandler = xoops_getHandler('notification');
263
                $notificationHandler->subscribe('faq', $newFaqObj->faqid(), 'approved', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
264
            }
265
            // Send notifications
266
            $newFaqObj->sendNotifications([Constants::SF_NOT_FAQ_SUBMITTED]);
267
268
            $redirect_msg = _MD_SF_QNA_RECEIVED_NEED_APPROVAL;
269
        }
270
271
        redirect_header('index.php', 2, $redirect_msg);
272
        break;