}
# Strip javascript "expression" from stylesheets.
- # http://msdn.microsoft.com/workshop/author/dhtml/overview/recalc.asp
+ # https://msdn.microsoft.com/en-us/library/ms537634.aspx
if ( $attribute == 'style' ) {
$value = Sanitizer::checkCss( $value );
}
* @return string normalized css
*/
public static function normalizeCss( $value ) {
-
// Decode character references like {
$value = Sanitizer::decodeCharReferences( $value );
];
$id = urlencode( strtr( $id, ' ', '_' ) );
- $id = str_replace( array_keys( $replace ), array_values( $replace ), $id );
+ $id = strtr( $id, $replace );
if ( !preg_match( '/^[a-zA-Z]/', $id ) && !in_array( 'noninitial', $options ) ) {
// Initial character must be a letter!