Code Duplication    Length = 3-5 lines in 2 locations

htdocs/modules/profile/class/field.php 2 locations

@@ 259-263 (lines=5) @@
256
            case 'radio':
257
                $value = is_array($value) ? $value[0] : $value;
258
                $options = $this->getVar('field_options');
259
                if (isset($options[$value])) {
260
                    $value = htmlspecialchars(defined($options[$value]) ? constant($options[$value]) : $options[$value]);
261
                } else {
262
                    $value = '';
263
                }
264
265
                return $value;
266
                break;
@@ 274-276 (lines=3) @@
271
                $ret     = array();
272
                if (count($options) > 0) {
273
                    foreach (array_keys($options) as $key) {
274
                        if (in_array($key, $value)) {
275
                            $ret[$key] = htmlspecialchars(defined($options[$key]) ? constant($options[$key]) : $options[$key]);
276
                        }
277
                    }
278
                }
279