Code Duplication    Length = 11-12 lines in 2 locations

func/validate.php 1 location

@@ 72-82 (lines=11) @@
69
			// domain part has two consecutive dots
70
			$is_valid = false;
71
		}
72
		elseif (!preg_match('/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/',
73
			str_replace("\\\\", "", $local)))
74
		{
75
			// character not valid in local part unless
76
			// local part is quoted
77
			if (!preg_match('/^"(\\\\"|[^"])+"$/',
78
				str_replace("\\\\", "", $local)))
79
			{
80
				$is_valid = false;
81
			}
82
		}
83
84
		// :NOTICE: Some network provider will return fake A record if
85
		// a dns query return fail, usually disp some ads.

src/Fwlib/Validator/Constraint/Email.php 1 location

@@ 130-141 (lines=12) @@
127
            // local part has two consecutive dots
128
            $valid = false;
129
130
        } elseif (!preg_match(
131
            '/^(\\\\.|[A-Za-z0-9!#%&`_=\\/$\'*+?^{}|~.-])+$/',
132
            str_replace("\\\\", "", $local)
133
        )) {
134
            // Character not valid in local part unless local part is quoted
135
            if (!preg_match(
136
                '/^"(\\\\"|[^"])+"$/',
137
                str_replace("\\\\", "", $local)
138
            )) {
139
                $valid = false;
140
            }
141
        }
142
143
        return $valid;
144
    }