Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
1 / 1
n/a
0 / 0
CRAP
n/a
0 / 0
1<?php
2
3declare(strict_types=1);
4
5/** @license For full copyright and license information, please see the LICENSE.md file. */
6
7namespace App\Modules\Mail\Domain\Contract;
8
9defined('AMMONLY_APP') || exit('Direct script access is forbidden.');
10
11/**
12 * Enterprise Email HTML Body Sanitizer Contract.
13 *
14 * Enforces OWASP ASVS 5.0 sanitization against XSS, CSS bleeding, and privacy leaks (web bugs).
15 *
16 * @package App\Modules\Mail\Domain\Contract
17 */
18interface MailHtmlSanitizerInterface
19{
20    /**
21     * Sanitizes raw untrusted email HTML body for safe isolated rendering.
22     *
23     * @param string $rawHtml           Raw HTML from email payload.
24     * @param bool   $allowRemoteImages Whether external remote images are permitted.
25     * @return array{html: string, hasBlockedImages: bool} Sanitized HTML and blocked status.
26     */
27    public function sanitize(string $rawHtml, bool $allowRemoteImages = false): array;
28}