0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-03-23 14:27:02 +00:00

Cleanup after data validation.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
This commit is contained in:
Edward Z. Yang 2012-10-27 02:30:58 -07:00
parent c0ad68108a
commit a44187a5c1
2 changed files with 4 additions and 0 deletions

2
NEWS
View File

@ -24,6 +24,8 @@ NEWS ( CHANGELOG and HISTORY ) HTMLPurifier
- Fix bug where background:url() always gets lower-cased - Fix bug where background:url() always gets lower-cased
(but not background-image:url()) (but not background-image:url())
- Fix bug with non lower-case color names in HTML - Fix bug with non lower-case color names in HTML
- Fix bug where data URI validation doesn't remove temporary files.
Thanks Javier Marín Ros <javiermarinros@gmail.com> for reporting.
4.4.0, released 2012-01-18 4.4.0, released 2012-01-18
# Removed PEARSax3 handler. # Removed PEARSax3 handler.

View File

@ -64,10 +64,12 @@ class HTMLPurifier_URIScheme_data extends HTMLPurifier_URIScheme {
file_put_contents($file, $raw_data); file_put_contents($file, $raw_data);
if (function_exists('exif_imagetype')) { if (function_exists('exif_imagetype')) {
$image_code = exif_imagetype($file); $image_code = exif_imagetype($file);
unlink($file);
} elseif (function_exists('getimagesize')) { } elseif (function_exists('getimagesize')) {
set_error_handler(array($this, 'muteErrorHandler')); set_error_handler(array($this, 'muteErrorHandler'));
$info = getimagesize($file); $info = getimagesize($file);
restore_error_handler(); restore_error_handler();
unlink($file);
if ($info == false) return false; if ($info == false) return false;
$image_code = $info[2]; $image_code = $info[2];
} else { } else {