Index: trunk/phase3/includes/Html.php |
— | — | @@ -335,13 +335,17 @@ |
336 | 336 | # and we don't need <> escaped here, we may as well not call |
337 | 337 | # htmlspecialchars(). FIXME: verify that we actually need to |
338 | 338 | # escape \n\r\t here, and explain why, exactly. |
339 | | - $ret .= " $key=$quote" . strtr( $value, array( |
340 | | - '&' => '&', |
341 | | - '"' => '"', |
342 | | - "\n" => ' ', |
343 | | - "\r" => ' ', |
344 | | - "\t" => '	' |
345 | | - ) ) . $quote; |
| 339 | + if ( $wgHtml5 ) { |
| 340 | + $ret .= " $key=$quote" . strtr( $value, array( |
| 341 | + '&' => '&', |
| 342 | + '"' => '"', |
| 343 | + "\n" => ' ', |
| 344 | + "\r" => ' ', |
| 345 | + "\t" => '	' |
| 346 | + ) ) . $quote; |
| 347 | + } else { |
| 348 | + $ret .= " $key=$quote" . Sanitizer::encodeAttribute( $value ) . $quote; |
| 349 | + } |
346 | 350 | } |
347 | 351 | } |
348 | 352 | return $ret; |