Code Duplication    Length = 12-12 lines in 2 locations

htdocs/class/xoopsform/formcheckbox.php 1 location

@@ 86-97 (lines=12) @@
83
     * @param  bool $encode To sanitizer the text?
84
     * @return array
85
     */
86
    public function getValue($encode = false)
87
    {
88
        if (!$encode) {
89
            return $this->_value;
90
        }
91
        $value = array();
92
        foreach ($this->_value as $val) {
93
            $value[] = $val ? htmlspecialchars($val, ENT_QUOTES) : $val;
94
        }
95
96
        return $value;
97
    }
98
99
    /**
100
     * Set the "value"

htdocs/class/xoopsform/formselect.php 1 location

@@ 115-126 (lines=12) @@
112
     * @param  bool $encode To sanitizer the text?
113
     * @return array
114
     */
115
    public function getValue($encode = false)
116
    {
117
        if (!$encode) {
118
            return $this->_value;
119
        }
120
        $value = array();
121
        foreach ($this->_value as $val) {
122
            $value[] = $val ? htmlspecialchars($val, ENT_QUOTES) : $val;
123
        }
124
125
        return $value;
126
    }
127
128
    /**
129
     * Set pre-selected values