Use standard temporary file for internal use of HTMLPurifier (#2383)
This commit is contained in:
parent
a2be574f36
commit
9dcfd9a5c2
|
|
@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org).
|
|||
|
||||
### Added
|
||||
|
||||
- Nothing
|
||||
- Use tmp dir in HTMLPurifier config
|
||||
|
||||
### Changed
|
||||
|
||||
|
|
|
|||
|
|
@ -1769,6 +1769,10 @@ class Html extends BaseWriter
|
|||
$result = '';
|
||||
if (!$this->isPdf && isset($worksheet->getComments()[$coordinate])) {
|
||||
$sanitizer = new HTMLPurifier();
|
||||
$cachePath = File::sysGetTempDir() . '/phpsppur';
|
||||
if (is_dir($cachePath) || mkdir($cachePath)) {
|
||||
$sanitizer->config->set('Cache.SerializerPath', $cachePath);
|
||||
}
|
||||
$sanitizedString = $sanitizer->purify($worksheet->getComment($coordinate)->getText()->getPlainText());
|
||||
if ($sanitizedString !== '') {
|
||||
$result .= '<a class="comment-indicator"></a>';
|
||||
|
|
|
|||
Loading…
Reference in New Issue