fixes for site back up and mailer, turned on md list rendering

This commit is contained in:
Ro 2022-03-18 16:58:11 -07:00
parent 8ad3fa38c5
commit a70c98afa0
3 changed files with 7 additions and 4 deletions

View file

@ -12,6 +12,7 @@ use League\CommonMark\MarkdownConverter;
use League\CommonMark\CommonMarkConverter; use League\CommonMark\CommonMarkConverter;
use HtmlSanitizer\Extension\Basic\BasicExtension; use HtmlSanitizer\Extension\Basic\BasicExtension;
use HtmlSanitizer\Extension\Iframe\IframeExtension; use HtmlSanitizer\Extension\Iframe\IframeExtension;
use HtmlSanitizer\Extension\Listing\ListExtension;
use HtmlSanitizer\SanitizerBuilder; use HtmlSanitizer\SanitizerBuilder;
use function _\orderBy; use function _\orderBy;
@ -70,10 +71,11 @@ class Contents
->parse(file_get_contents($file)); ->parse(file_get_contents($file));
//never trust the front end. clean it up //never trust the front end. clean it up
//add what sanitizer extensions we need manually
$builder = new SanitizerBuilder(); $builder = new SanitizerBuilder();
$builder->registerExtension(new BasicExtension()); $builder->registerExtension(new BasicExtension());
$builder->registerExtension(new IframeExtension()); $builder->registerExtension(new IframeExtension());
$builder->registerExtension(new ListExtension());
//relative-a and relative-image //relative-a and relative-image
$builder->registerExtension( $builder->registerExtension(
@ -84,7 +86,7 @@ class Contents
); );
$detergent = [ $detergent = [
"extensions" => ["basic", "relative-a", "relative-image", "iframe"], "extensions" => ["basic", "list","relative-a", "relative-image", "iframe"],
"tags" => [ "tags" => [
"div" => [ "div" => [
"allowed_attributes" => ["class", "title", "id", "style"], "allowed_attributes" => ["class", "title", "id", "style"],

View file

@ -6,6 +6,7 @@ use Slim\Views\Twig;
use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception; use PHPMailer\PHPMailer\Exception;
use brain\data\Settings; use brain\data\Settings;
use brain\data\Session;
class Mailer class Mailer
{ {

View file

@ -17,10 +17,10 @@ class Maintenance
mkdir("../config/backups", 0755, true); mkdir("../config/backups", 0755, true);
} }
//creat backup zip //creat backup zip
$zip = new ZipArchive(); $zip = new \ZipArchive();
$zip->open( $zip->open(
"../config/backups/latest_back.zip", "../config/backups/latest_back.zip",
ZipArchive::CREATE | ZipArchive::OVERWRITE \ZipArchive::CREATE | \ZipArchive::OVERWRITE
); );
//gather data and path info for md pages //gather data and path info for md pages
$pagePath = "../content/pages"; $pagePath = "../content/pages";