Code Duplication    Length = 5-5 lines in 2 locations

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

@@ 67-71 (lines=5) @@
64
     */
65
    public function setVar($key, $value)
66
    {
67
        if ($key === 'field_options' && is_array($value)) {
68
            foreach (array_keys($value) as $idx) {
69
                $value[$idx] = base64_encode($value[$idx]);
70
            }
71
        }
72
        parent::setVar($key, $value);
73
    }
74
@@ 83-87 (lines=5) @@
80
    public function getVar($key, $format = 's')
81
    {
82
        $value = parent::getVar($key, $format);
83
        if ($key === 'field_options' && !empty($value)) {
84
            foreach (array_keys($value) as $idx) {
85
                $value[$idx] = base64_decode($value[$idx]);
86
            }
87
        }
88
        return $value;
89
    }
90