Code Duplication    Length = 12-12 lines in 3 locations

admin_pages/messages/Messages_Admin_Page.core.php 3 locations

@@ 1883-1894 (lines=12) @@
1880
        $nonce_ref = 'activate_' . $this->_req_data['context'] . '_toggle_nonce';
1881
        $this->_verify_nonce($nonce, $nonce_ref);
1882
        $status = $this->_req_data['status'];
1883
        if ($status !== 'off' && $status !== 'on') {
1884
            EE_Error::add_error(
1885
                sprintf(
1886
                    esc_html__('The given status (%s) is not valid. Must be "off" or "on"', 'event_espresso'),
1887
                    $this->_req_data['status']
1888
                ),
1889
                __FILE__,
1890
                __FUNCTION__,
1891
                __LINE__
1892
            );
1893
            $success = false;
1894
        }
1895
        $message_template_group = EEM_Message_Template_Group::instance()->get_one_by_ID(
1896
            $this->_req_data['message_template_group_id']
1897
        );
@@ 3866-3877 (lines=12) @@
3863
        // do check to verify we have a valid status.
3864
        $status = $this->_req_data['status'];
3865
3866
        if ($status !== 'off' && $status !== 'on') {
3867
            EE_Error::add_error(
3868
                sprintf(
3869
                    esc_html__('The given status (%s) is not valid. Must be "off" or "on"', 'event_espresso'),
3870
                    $this->_req_data['status']
3871
                ),
3872
                __FILE__,
3873
                __FUNCTION__,
3874
                __LINE__
3875
            );
3876
            $success = false;
3877
        }
3878
3879
        if ($success) {
3880
            // made it here?  Stop dawdling then!!
@@ 3946-3957 (lines=12) @@
3943
        // do check to verify we have a valid status.
3944
        $status = $this->_req_data['status'];
3945
3946
        if ($status !== 'activate' && $status !== 'deactivate') {
3947
            EE_Error::add_error(
3948
                sprintf(
3949
                    esc_html__('The given status (%s) is not valid. Must be "active" or "inactive"', 'event_espresso'),
3950
                    $this->_req_data['status']
3951
                ),
3952
                __FILE__,
3953
                __FUNCTION__,
3954
                __LINE__
3955
            );
3956
            $success = false;
3957
        }
3958
3959
3960
        // do a nonce check here since we're not arriving via a normal route