Make WordPress Core

Ticket #37248: 37248.patch

File 37248.patch, 3.4 KB (added by mrahmadawais, 9 years ago)

KSES: Flexbox Properties for the List of Safe CSS Attributes

  • wp-includes/kses.php

     
    551551        $allowed_protocols = wp_allowed_protocols();
    552552        $string = wp_kses_no_null( $string, array( 'slash_zero' => 'keep' ) );
    553553        $string = wp_kses_js_entities( $string );
    554        
     554
    555555        // Preserve leading and trailing whitespace.
    556556        $matches = array();
    557557        preg_match('/^\s*/', $string, $matches);
     
    563563        } else {
    564564                $string = substr( $string, strlen( $lead ), -strlen( $trail ) );
    565565        }
    566        
     566
    567567        // Parse attribute name and value from input.
    568568        $split = preg_split( '/\s*=\s*/', $string, 2 );
    569569        $name = $split[0];
     
    600600                $value = '';
    601601                $vless = 'y';
    602602        }
    603        
     603
    604604        // Sanitize attribute by name.
    605605        wp_kses_attr_check( $name, $value, $string, $vless, $element, $allowed_html );
    606606
     
    10631063        } else {
    10641064                $xhtml_slash = '';
    10651065        }
    1066        
     1066
    10671067        // Split it
    10681068        $attrarr = wp_kses_hair_parse( $attr );
    10691069        if ( false === $attrarr ) {
     
    10731073        // Make sure all input is returned by adding front and back matter.
    10741074        array_unshift( $attrarr, $begin . $slash . $elname );
    10751075        array_push( $attrarr, $xhtml_slash . $end );
    1076        
     1076
    10771077        return $attrarr;
    10781078}
    10791079
     
    17141714         * @param array $attr List of allowed CSS attributes.
    17151715         */
    17161716        $allowed_attr = apply_filters( 'safe_style_css', array(
     1717                '-moz-box-flex',
     1718                '-moz-box-ordinal-group',
     1719                '-ms-flex',
     1720                '-ms-flex-order',
     1721                '-webkit-box-flex',
     1722                '-webkit-box-ordinal-group',
     1723                '-webkit-flex',
     1724                '-webkit-order',
     1725                'align-content',
     1726                'align-items',
     1727                'align-self',
    17171728                'background',
    17181729                'background-color',
    1719 
    17201730                'border',
    1721                 'border-width',
    1722                 'border-color',
    1723                 'border-style',
    1724                 'border-right',
    1725                 'border-right-color',
    1726                 'border-right-style',
    1727                 'border-right-width',
    17281731                'border-bottom',
    17291732                'border-bottom-color',
    17301733                'border-bottom-style',
    17311734                'border-bottom-width',
     1735                'border-collapse',
     1736                'border-color',
    17321737                'border-left',
    17331738                'border-left-color',
    17341739                'border-left-style',
    17351740                'border-left-width',
     1741                'border-right',
     1742                'border-right-color',
     1743                'border-right-style',
     1744                'border-right-width',
     1745                'border-spacing',
     1746                'border-style',
    17361747                'border-top',
    17371748                'border-top-color',
    17381749                'border-top-style',
    17391750                'border-top-width',
    1740 
    1741                 'border-spacing',
    1742                 'border-collapse',
     1751                'border-width',
    17431752                'caption-side',
    1744 
     1753                'clear',
    17451754                'color',
     1755                'cursor',
     1756                'direction',
     1757                'display',
     1758                'flex',
     1759                'flex',
     1760                'flex-basis',
     1761                'flex-direction',
     1762                'flex-flow',
     1763                'flex-grow',
     1764                'flex-shrink',
     1765                'flex-wrap',
     1766                'float',
    17461767                'font',
    17471768                'font-family',
    17481769                'font-size',
     
    17491770                'font-style',
    17501771                'font-variant',
    17511772                'font-weight',
     1773                'height',
     1774                'justify-content',
    17521775                'letter-spacing',
    17531776                'line-height',
    1754                 'text-decoration',
    1755                 'text-indent',
    1756                 'text-align',
    1757 
    1758                 'height',
    1759                 'min-height',
    1760                 'max-height',
    1761 
    1762                 'width',
    1763                 'min-width',
    1764                 'max-width',
    1765 
     1777                'list-style-type',
    17661778                'margin',
    1767                 'margin-right',
    17681779                'margin-bottom',
    17691780                'margin-left',
     1781                'margin-right',
    17701782                'margin-top',
    1771 
     1783                'max-height',
     1784                'max-width',
     1785                'min-height',
     1786                'min-width',
     1787                'order',
     1788                'overflow',
    17721789                'padding',
    1773                 'padding-right',
    17741790                'padding-bottom',
    17751791                'padding-left',
     1792                'padding-right',
    17761793                'padding-top',
    1777 
    1778                 'clear',
    1779                 'cursor',
    1780                 'direction',
    1781                 'float',
    1782                 'overflow',
     1794                'text-align',
     1795                'text-decoration',
     1796                'text-indent',
    17831797                'vertical-align',
    1784                 'list-style-type',
     1798                'width',
    17851799        ) );
    17861800
    17871801        if ( empty($allowed_attr) )