Skip to content

Commit

Permalink
Merge pull request #10 from nswdpc/ss5-cache-path
Browse files Browse the repository at this point in the history
Update cache path
  • Loading branch information
tardinha authored Sep 2, 2024
2 parents 71accad + 4ee7a94 commit 8238790
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Models/ContentSanitiser.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace NSWDPC\Utilities\Trumbowyg;

use SilverStripe\Assets\Filesystem;
use Silverstripe\Core\Config\Configurable;
use Silverstripe\Core\Config\Config;
use Silverstripe\ORM\ValidationException;
Expand Down Expand Up @@ -49,14 +50,20 @@ public static function getAllowedHTMLTagsAsArray() : array {
* @return array
*/
public static function generateConfig() : array {
$serializerPath = TEMP_PATH . "/HtmlPurifier/Serializer";
if(!is_dir($serializerPath)) {
Filesystem::makeFolder($serializerPath);
}
return [
'Core.Encoding' => 'UTF-8',
'HTML.AllowedElements' => self::getAllowedHTMLTagsAsArray(),
'HTML.AllowedAttributes' => ['href'],
'URI.AllowedSchemes' => ['http','https','mailto','callto'],
'Attr.ID.HTML5' => true,
'AutoFormat.RemoveEmpty.RemoveNbsp' => true,
'AutoFormat.RemoveEmpty' => true
'AutoFormat.RemoveEmpty' => true,
'Cache.SerializerPath' => $serializerPath,
'Cache.SerializerPermissions' => null
];
}

Expand Down

0 comments on commit 8238790

Please # to comment.