Code Duplication    Length = 9-12 lines in 2 locations

wp-includes/kses.php 2 locations

@@ 1168-1179 (lines=12) @@
1165
				$ok = false;
1166
			break;
1167
1168
		case 'maxval' :
1169
			// The maxval check does two things: it checks that the attribute value is
1170
			// an integer from 0 and up, without an excessive amount of zeroes or
1171
			// whitespace (to avoid Buffer Overflows). It also checks that the attribute
1172
			// value is not greater than the given value.
1173
			// This check can be used to avoid Denial of Service attacks.
1174
1175
			if (!preg_match('/^\s{0,6}[0-9]{1,6}\s{0,6}$/', $value))
1176
				$ok = false;
1177
			if ($value > $checkvalue)
1178
				$ok = false;
1179
			break;
1180
1181
		case 'minval' :
1182
			// The minval check makes sure that the attribute value is a positive integer,
@@ 1181-1189 (lines=9) @@
1178
				$ok = false;
1179
			break;
1180
1181
		case 'minval' :
1182
			// The minval check makes sure that the attribute value is a positive integer,
1183
			// and that it is not smaller than the given value.
1184
1185
			if (!preg_match('/^\s{0,6}[0-9]{1,6}\s{0,6}$/', $value))
1186
				$ok = false;
1187
			if ($value < $checkvalue)
1188
				$ok = false;
1189
			break;
1190
1191
		case 'valueless' :
1192
			// The valueless check makes sure if the attribute has a value