Code Duplication    Length = 5-7 lines in 2 locations

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

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