Code Duplication    Length = 4-4 lines in 4 locations

class/BaseSmartObject.php 4 locations

@@ 835-838 (lines=4) @@
832
                $cleanv = is_string($cleanv) ? trim($cleanv) : $cleanv;
833
                switch ($v['data_type']) {
834
                    case XOBJ_DTYPE_TXTBOX:
835
                        if ($v['required'] && '0' != $cleanv && '' == $cleanv) {
836
                            $this->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $k));
837
                            continue 2;
838
                        }
839
                        if (isset($v['maxlength']) && strlen($cleanv) > (int)$v['maxlength']) {
840
                            $this->setErrors(sprintf(_XOBJ_ERR_SHORTERTHAN, $k, (int)$v['maxlength']));
841
                            continue 2;
@@ 850-853 (lines=4) @@
847
                        }
848
                        break;
849
                    case XOBJ_DTYPE_TXTAREA:
850
                        if ($v['required'] && '0' != $cleanv && '' == $cleanv) {
851
                            $this->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $k));
852
                            continue 2;
853
                        }
854
                        if (!$v['not_gpc']) {
855
                            $cleanv = $ts->stripSlashesGPC($ts->censorString($cleanv));
856
                        } else {
@@ 881-884 (lines=4) @@
878
                        break;
879
880
                    case XOBJ_DTYPE_EMAIL:
881
                        if ($v['required'] && '' === $cleanv) {
882
                            $this->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $k));
883
                            continue 2;
884
                        }
885
                        if ('' !== $cleanv
886
                            && !preg_match("/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+([\.][a-z0-9-]+)+$/i", $cleanv)) {
887
                            $this->setErrors('Invalid Email');
@@ 895-898 (lines=4) @@
892
                        }
893
                        break;
894
                    case XOBJ_DTYPE_URL:
895
                        if ($v['required'] && '' === $cleanv) {
896
                            $this->setErrors(sprintf(_XOBJ_ERR_REQUIRED, $k));
897
                            continue 2;
898
                        }
899
                        if ('' !== $cleanv && !preg_match("/^http[s]*:\/\//i", $cleanv)) {
900
                            $cleanv = 'http://' . $cleanv;
901
                        }