From a70c98afa05bacaab2bfe66ed578ddfb593eda06 Mon Sep 17 00:00:00 2001 From: Ro Date: Fri, 18 Mar 2022 16:58:11 -0700 Subject: [PATCH] fixes for site back up and mailer, turned on md list rendering --- brain/data/Contents.php | 6 ++++-- brain/utility/Mailer.php | 1 + brain/utility/Maintenance.php | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/brain/data/Contents.php b/brain/data/Contents.php index 27edc9d..9fd6b41 100644 --- a/brain/data/Contents.php +++ b/brain/data/Contents.php @@ -12,6 +12,7 @@ use League\CommonMark\MarkdownConverter; use League\CommonMark\CommonMarkConverter; use HtmlSanitizer\Extension\Basic\BasicExtension; use HtmlSanitizer\Extension\Iframe\IframeExtension; +use HtmlSanitizer\Extension\Listing\ListExtension; use HtmlSanitizer\SanitizerBuilder; use function _\orderBy; @@ -70,10 +71,11 @@ class Contents ->parse(file_get_contents($file)); //never trust the front end. clean it up - + //add what sanitizer extensions we need manually $builder = new SanitizerBuilder(); $builder->registerExtension(new BasicExtension()); $builder->registerExtension(new IframeExtension()); + $builder->registerExtension(new ListExtension()); //relative-a and relative-image $builder->registerExtension( @@ -84,7 +86,7 @@ class Contents ); $detergent = [ - "extensions" => ["basic", "relative-a", "relative-image", "iframe"], + "extensions" => ["basic", "list","relative-a", "relative-image", "iframe"], "tags" => [ "div" => [ "allowed_attributes" => ["class", "title", "id", "style"], diff --git a/brain/utility/Mailer.php b/brain/utility/Mailer.php index e1b15f2..81bec42 100644 --- a/brain/utility/Mailer.php +++ b/brain/utility/Mailer.php @@ -6,6 +6,7 @@ use Slim\Views\Twig; use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; use brain\data\Settings; +use brain\data\Session; class Mailer { diff --git a/brain/utility/Maintenance.php b/brain/utility/Maintenance.php index a7a6865..63bed09 100644 --- a/brain/utility/Maintenance.php +++ b/brain/utility/Maintenance.php @@ -17,10 +17,10 @@ class Maintenance mkdir("../config/backups", 0755, true); } //creat backup zip - $zip = new ZipArchive(); + $zip = new \ZipArchive(); $zip->open( "../config/backups/latest_back.zip", - ZipArchive::CREATE | ZipArchive::OVERWRITE + \ZipArchive::CREATE | \ZipArchive::OVERWRITE ); //gather data and path info for md pages $pagePath = "../content/pages";