Code Duplication    Length = 14-15 lines in 2 locations

code/Extension/UserFormValidator.php 2 locations

@@ 96-110 (lines=15) @@
93
                }
94
95
                // Check that the top is the right group
96
                if ($top->EndID != $field->ID) {
97
                    $this->validationError(
98
                        'FormFields',
99
                        _t(
100
                            __CLASS__.".WRONG_GROUP_END",
101
                            "'{name}' found closes the wrong group '{group}'",
102
                            array(
103
                                'name' => $field->CMSTitle,
104
                                'group' => $top->CMSTitle
105
                            )
106
                        ),
107
                        'error'
108
                    );
109
                    return false;
110
                }
111
112
                // Unnest group
113
                array_pop($stack);
@@ 117-130 (lines=14) @@
114
            }
115
116
            // Normal field type
117
            if ($conditionalStep && $field->Required) {
118
                $this->validationError(
119
                    'FormFields',
120
                    _t(
121
                        __CLASS__.".CONDITIONAL_REQUIRED",
122
                        "Required field '{name}' cannot be placed within a conditional page",
123
                        array(
124
                            'name' => $field->CMSTitle
125
                        )
126
                    ),
127
                    'error'
128
                );
129
                return false;
130
            }
131
        }
132
133
        return true;