Code Duplication    Length = 15-15 lines in 3 locations

wp-includes/kses.php 3 locations

@@ 964-978 (lines=15) @@
961
962
			case 2 : // attribute value, a URL after href= for instance
963
964
				if (preg_match('%^"([^"]*)"(\s+|/?$)%', $attr, $match))
965
					// "value"
966
					{
967
					$thisval = $match[1];
968
					if ( in_array(strtolower($attrname), $uris) )
969
						$thisval = wp_kses_bad_protocol($thisval, $allowed_protocols);
970
971
					if(false === array_key_exists($attrname, $attrarr)) {
972
						$attrarr[$attrname] = array ('name' => $attrname, 'value' => $thisval, 'whole' => "$attrname=\"$thisval\"", 'vless' => 'n');
973
					}
974
					$working = 1;
975
					$mode = 0;
976
					$attr = preg_replace('/^"[^"]*"(\s+|$)/', '', $attr);
977
					break;
978
				}
979
980
				if (preg_match("%^'([^']*)'(\s+|/?$)%", $attr, $match))
981
					// 'value'
@@ 980-994 (lines=15) @@
977
					break;
978
				}
979
980
				if (preg_match("%^'([^']*)'(\s+|/?$)%", $attr, $match))
981
					// 'value'
982
					{
983
					$thisval = $match[1];
984
					if ( in_array(strtolower($attrname), $uris) )
985
						$thisval = wp_kses_bad_protocol($thisval, $allowed_protocols);
986
987
					if(false === array_key_exists($attrname, $attrarr)) {
988
						$attrarr[$attrname] = array ('name' => $attrname, 'value' => $thisval, 'whole' => "$attrname='$thisval'", 'vless' => 'n');
989
					}
990
					$working = 1;
991
					$mode = 0;
992
					$attr = preg_replace("/^'[^']*'(\s+|$)/", '', $attr);
993
					break;
994
				}
995
996
				if (preg_match("%^([^\s\"']+)(\s+|/?$)%", $attr, $match))
997
					// value
@@ 996-1010 (lines=15) @@
993
					break;
994
				}
995
996
				if (preg_match("%^([^\s\"']+)(\s+|/?$)%", $attr, $match))
997
					// value
998
					{
999
					$thisval = $match[1];
1000
					if ( in_array(strtolower($attrname), $uris) )
1001
						$thisval = wp_kses_bad_protocol($thisval, $allowed_protocols);
1002
1003
					if(false === array_key_exists($attrname, $attrarr)) {
1004
						$attrarr[$attrname] = array ('name' => $attrname, 'value' => $thisval, 'whole' => "$attrname=\"$thisval\"", 'vless' => 'n');
1005
					}
1006
					// We add quotes to conform to W3C's HTML spec.
1007
					$working = 1;
1008
					$mode = 0;
1009
					$attr = preg_replace("%^[^\s\"']+(\s+|$)%", '', $attr);
1010
				}
1011
1012
				break;
1013
		} // switch