mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-01-03 13:21:51 +00:00
Don't truncate alts.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
This commit is contained in:
parent
ae1828d955
commit
958ba65595
4
NEWS
4
NEWS
@ -9,6 +9,10 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier
|
|||||||
. Internal change
|
. Internal change
|
||||||
==========================
|
==========================
|
||||||
|
|
||||||
|
4.8.0, unknown release date
|
||||||
|
- alt truncation could result in malformed UTF-8 sequence. Don't
|
||||||
|
truncate. Thanks Brandon Farber for reporting.
|
||||||
|
|
||||||
4.7.0, released 2015-08-04
|
4.7.0, released 2015-08-04
|
||||||
# opacity is now considered a "tricky" CSS property rather than a
|
# opacity is now considered a "tricky" CSS property rather than a
|
||||||
proprietary one.
|
proprietary one.
|
||||||
|
@ -32,8 +32,7 @@ class HTMLPurifier_AttrTransform_ImgRequired extends HTMLPurifier_AttrTransform
|
|||||||
if ($src) {
|
if ($src) {
|
||||||
$alt = $config->get('Attr.DefaultImageAlt');
|
$alt = $config->get('Attr.DefaultImageAlt');
|
||||||
if ($alt === null) {
|
if ($alt === null) {
|
||||||
// truncate if the alt is too long
|
$attr['alt'] = basename($attr['src']);
|
||||||
$attr['alt'] = substr(basename($attr['src']), 0, 40);
|
|
||||||
} else {
|
} else {
|
||||||
$attr['alt'] = $alt;
|
$attr['alt'] = $alt;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user