diff --git a/app/Http/Requests/SaveClientPortalSettings.php b/app/Http/Requests/SaveClientPortalSettings.php index 7912c0df45da..cd81bf7d31dd 100644 --- a/app/Http/Requests/SaveClientPortalSettings.php +++ b/app/Http/Requests/SaveClientPortalSettings.php @@ -38,7 +38,7 @@ class SaveClientPortalSettings extends Request $input = $this->all(); if ($this->client_view_css && Utils::isNinja()) { - $input['client_view_css'] = HTMLUtils::sanitize($this->client_view_css); + $input['client_view_css'] = HTMLUtils::sanitizeCSS($this->client_view_css); } if (Utils::isNinja()) { @@ -53,7 +53,7 @@ class SaveClientPortalSettings extends Request $input['subdomain'] = null; } } - + $this->replace($input); return $this->all(); diff --git a/app/Libraries/HTMLUtils.php b/app/Libraries/HTMLUtils.php index 412252a1eb6d..3e3252a922ca 100644 --- a/app/Libraries/HTMLUtils.php +++ b/app/Libraries/HTMLUtils.php @@ -7,7 +7,7 @@ use HTMLPurifier_Config; class HTMLUtils { - public static function sanitize($css) + public static function sanitizeCSS($css) { // Allow referencing the body element $css = preg_replace('/(?purify($html); + } + + public static function encodeJSON($string) + { + return htmlentities(json_encode($string), ENT_NOQUOTES); + } } diff --git a/resources/views/accounts/client_portal.blade.php b/resources/views/accounts/client_portal.blade.php index 71fa231e65e2..22debed199ac 100644 --- a/resources/views/accounts/client_portal.blade.php +++ b/resources/views/accounts/client_portal.blade.php @@ -372,7 +372,7 @@ iframe.src = '{{ rtrim(SITE_URL ,'/') }}/view/'