Code Duplication    Length = 15-15 lines in 3 locations

src/wp-includes/kses.php 3 locations

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