Code Duplication    Length = 5-7 lines in 2 locations

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

@@ 270-276 (lines=7) @@
267
            case "select":
268
            case "radio":
269
                $options = $this->getVar('field_options');
270
                if (isset($options[$value])) {
271
                    $value = htmlspecialchars(
272
                        defined($options[$value]) ? constant($options[$value]) : $options[$value]
273
                    );
274
                } else {
275
                    $value = "";
276
                }
277
                return $value;
278
                break;
279
@@ 286-290 (lines=5) @@
283
                $ret = array();
284
                if (count($options) > 0) {
285
                    foreach (array_keys($options) as $key) {
286
                        if (in_array($key, $value)) {
287
                            $ret[$key] = htmlspecialchars(
288
                                defined($options[$key]) ? constant($options[$key]) : $options[$key]
289
                            );
290
                        }
291
                    }
292
                }
293
                return $ret;