Code Duplication    Length = 4-4 lines in 4 locations

class/BaseSmartObject.php 4 locations

@@ 830-833 (lines=4) @@
827
                $cleanv = is_string($cleanv) ? trim($cleanv) : $cleanv;
828
                switch ($v['data_type']) {
829
                    case XOBJ_DTYPE_TXTBOX:
830
                        if ($v['required'] && '0' != $cleanv && '' == $cleanv) {
831
                            $this->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $k));
832
                            continue 2;
833
                        }
834
                        if (isset($v['maxlength']) && strlen($cleanv) > (int)$v['maxlength']) {
835
                            $this->setErrors(sprintf(_XOBJ_ERR_SHORTERTHAN, $k, (int)$v['maxlength']));
836
                            continue 2;
@@ 845-848 (lines=4) @@
842
                        }
843
                        break;
844
                    case XOBJ_DTYPE_TXTAREA:
845
                        if ($v['required'] && '0' != $cleanv && '' == $cleanv) {
846
                            $this->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $k));
847
                            continue 2;
848
                        }
849
                        if (!$v['not_gpc']) {
850
                            $cleanv = $ts->stripSlashesGPC($ts->censorString($cleanv));
851
                        } else {
@@ 876-879 (lines=4) @@
873
                        break;
874
875
                    case XOBJ_DTYPE_EMAIL:
876
                        if ($v['required'] && '' === $cleanv) {
877
                            $this->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $k));
878
                            continue 2;
879
                        }
880
                        if ('' !== $cleanv
881
                            && !preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$/i", $cleanv)) {
882
                            $this->setErrors('Invalid Email');
@@ 890-893 (lines=4) @@
887
                        }
888
                        break;
889
                    case XOBJ_DTYPE_URL:
890
                        if ($v['required'] && '' === $cleanv) {
891
                            $this->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $k));
892
                            continue 2;
893
                        }
894
                        if ('' !== $cleanv && !preg_match("/^http[s]*:\/\//i", $cleanv)) {
895
                            $cleanv = 'http://' . $cleanv;
896
                        }