Ticket #47367: 47367.3.diff
File 47367.3.diff, 5.2 KB (added by , 5 years ago) |
---|
-
src/wp-includes/kses.php
diff --git a/src/wp-includes/kses.php b/src/wp-includes/kses.php index 7975949370..07edc91ea9 100644
a b function safecss_filter_attr( $css, $deprecated = '' ) { 2071 2071 * @since 5.0.0 Added support for `background-image`. 2072 2072 * @since 5.1.0 Added support for `text-transform`. 2073 2073 * @since 5.2.0 Added support for `background-position` and `grid-template-columns` 2074 * @since 5.3.0 Added support for `flex`, `flex-grow`, `flex-shrink`, and `flex-basis`. 2074 * @since 5.3.0 Added support for `grid`, `flex` and `column` layout properties. 2075 * Extend `background-*` support of individual properties. 2075 2076 * 2076 2077 * @param string[] $attr Array of allowed CSS attributes. 2077 2078 */ … … function safecss_filter_attr( $css, $deprecated = '' ) { 2082 2083 'background-color', 2083 2084 'background-image', 2084 2085 'background-position', 2086 'background-size', 2087 'background-attachment', 2088 'background-blend-mode', 2085 2089 2086 2090 'border', 2091 'border-radius', 2087 2092 'border-width', 2088 2093 'border-color', 2089 2094 'border-style', … … function safecss_filter_attr( $css, $deprecated = '' ) { 2108 2113 'border-collapse', 2109 2114 'caption-side', 2110 2115 2116 'columns', 2117 'column-count', 2118 'column-fill', 2119 'column-gap', 2120 'column-rule', 2121 'column-span', 2122 'column-width', 2123 2111 2124 'color', 2112 2125 'font', 2113 2126 'font-family', … … function safecss_filter_attr( $css, $deprecated = '' ) { 2143 2156 'padding-top', 2144 2157 2145 2158 'flex', 2159 'flex-basis', 2160 'flex-direction', 2161 'flex-flow', 2146 2162 'flex-grow', 2147 2163 'flex-shrink', 2148 'flex-basis', 2164 2165 'grid-template-columns', 2166 'grid-auto-columns', 2167 'grid-column-start', 2168 'grid-column-end', 2169 'grid-column-gap', 2170 'grid-template-rows', 2171 'grid-auto-rows', 2172 'grid-row-start', 2173 'grid-row-end', 2174 'grid-row-gap', 2175 'grid-gap', 2176 2177 'justify-content', 2178 'justify-items', 2179 'justify-self', 2180 'align-content', 2181 'align-items', 2182 'align-self', 2149 2183 2150 2184 'clear', 2151 2185 'cursor', … … function safecss_filter_attr( $css, $deprecated = '' ) { 2154 2188 'overflow', 2155 2189 'vertical-align', 2156 2190 'list-style-type', 2157 'grid-template-columns',2158 2191 ) 2159 2192 ); 2160 2193 -
tests/phpunit/tests/kses.php
diff --git a/tests/phpunit/tests/kses.php b/tests/phpunit/tests/kses.php index 039d5400b2..ae4a7dc3a2 100644
a b EOF; 839 839 'css' => 'background: green url("foo.jpg") no-repeat fixed center', 840 840 'expected' => 'background: green url("foo.jpg") no-repeat fixed center', 841 841 ), 842 // Additional background attributes introduced in 5.3. 843 array( 844 'css' => 'background-size: cover;background-size: 200px 100px;background-attachment: local, scroll;background-blend-mode: hard-light', 845 'expected' => 'background-size: cover;background-size: 200px 100px;background-attachment: local, scroll;background-blend-mode: hard-light', 846 ), 847 // `border-radius` attribute introduced in 5.3. 848 array( 849 'css' => 'border-radius: 10% 30% 50% 70%;border-radius: 30px', 850 'expected' => 'border-radius: 10% 30% 50% 70%;border-radius: 30px', 851 ), 842 852 // `flex` and related attributes introduced in 5.3. 843 853 array( 844 'css' => 'flex: 0 1 auto;flex-basis: 75%;flex-shrink: 0;flex-grow: 1', 845 'expected' => 'flex: 0 1 auto;flex-basis: 75%;flex-shrink: 0;flex-grow: 1', 854 'css' => 'flex: 0 1 auto;flex-basis: 75%;flex-direction: row-reverse;flex-flow: row-reverse nowrap;flex-grow: 2;flex-shrink: 1', 855 'expected' => 'flex: 0 1 auto;flex-basis: 75%;flex-direction: row-reverse;flex-flow: row-reverse nowrap;flex-grow: 2;flex-shrink: 1', 856 ), 857 // `grid` and related attributes introduced in 5.3. 858 array( 859 'css' => 'grid-template-columns: 1fr 60px;grid-auto-columns: min-content;grid-column-start: span 2;grid-column-end: -1;grid-column-gap: 10%;grid-gap: 10px 20px', 860 'expected' => 'grid-template-columns: 1fr 60px;grid-auto-columns: min-content;grid-column-start: span 2;grid-column-end: -1;grid-column-gap: 10%;grid-gap: 10px 20px', 861 ), 862 array( 863 'css' => 'grid-template-rows: 40px 4em 40px;grid-auto-rows: min-content;grid-row-start: -1;grid-row-end: 3;grid-row-gap: 1em', 864 'expected' => 'grid-template-rows: 40px 4em 40px;grid-auto-rows: min-content;grid-row-start: -1;grid-row-end: 3;grid-row-gap: 1em', 865 ), 866 // `grid` does not yet support functions or `\` 867 array( 868 'css' => 'grid-template-columns: repeat(2, 50px 1fr);grid-template: 1em / 20% 20px 1fr', 869 'expected' => '', 870 ), 871 // `flex` and `grid` alignments introduced in 5.3. 872 array( 873 'css' => 'align-content: space-between;align-items: start;align-self: center;justify-items: center;justify-content: space-between;justify-self: end', 874 'expected' => 'align-content: space-between;align-items: start;align-self: center;justify-items: center;justify-content: space-between;justify-self: end', 875 ), 876 // `columns` and related attributes introduced in 5.3 877 array( 878 'css' => 'columns: 6rem auto;column-count: 4;column-fill: balance;column-gap: 9px;column-rule: thick inset blue;column-span: none;column-width: 120px', 879 'expected' => 'columns: 6rem auto;column-count: 4;column-fill: balance;column-gap: 9px;column-rule: thick inset blue;column-span: none;column-width: 120px', 846 880 ), 847 881 ); 848 882 }