mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-07-31 19:30:21 +02:00
Fix E_NOTICE from indexing into empty string.
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
This commit is contained in:
@@ -63,13 +63,15 @@ class HTMLPurifier_TagTransform_Font extends HTMLPurifier_TagTransform
|
||||
// handle size transform
|
||||
if (isset($attr['size'])) {
|
||||
// normalize large numbers
|
||||
if ($attr['size']{0} == '+' || $attr['size']{0} == '-') {
|
||||
$size = (int) $attr['size'];
|
||||
if ($size < -2) $attr['size'] = '-2';
|
||||
if ($size > 4) $attr['size'] = '+4';
|
||||
} else {
|
||||
$size = (int) $attr['size'];
|
||||
if ($size > 7) $attr['size'] = '7';
|
||||
if ($attr['size'] !== '') {
|
||||
if ($attr['size']{0} == '+' || $attr['size']{0} == '-') {
|
||||
$size = (int) $attr['size'];
|
||||
if ($size < -2) $attr['size'] = '-2';
|
||||
if ($size > 4) $attr['size'] = '+4';
|
||||
} else {
|
||||
$size = (int) $attr['size'];
|
||||
if ($size > 7) $attr['size'] = '7';
|
||||
}
|
||||
}
|
||||
if (isset($this->_size_lookup[$attr['size']])) {
|
||||
$prepend_style .= 'font-size:' .
|
||||
|
Reference in New Issue
Block a user