| @@ -1,12 +1,18 @@ | ||
| 1 | 1 | <?php |
| 2 | +// phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- View file, its variables are local to the include scope, not true globals. | |
| 3 | +defined('ABSPATH') || die('Restricted Access'); | |
| 2 | 4 | if (strpos($this->content, 'acym__wysid__template') !== false) { |
| 3 | 5 | $bodyPos = strpos($this->content, '<body>'); |
| 4 | 6 | $endBodyPos = strpos($this->content, '</body>'); |
| 7 | + | |
| 8 | + $emailContent = $this->content; | |
| 9 | + | |
| 5 | 10 | if ($bodyPos !== false && $endBodyPos !== false) { |
| 6 | - echo substr(substr($this->content, 0, $endBodyPos), $bodyPos + 6); | |
| 7 | - } else { | |
| 8 | - echo $this->content; | |
| 11 | + $emailContent = substr(substr($this->content, 0, $endBodyPos), $bodyPos + 6); | |
| 9 | 12 | } |
| 13 | + | |
| 14 | + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Raw newsletter content built by the user with the email editor. | |
| 15 | + echo $emailContent; | |
| 10 | 16 | } else { |
| 11 | - echo $this->defaultTemplate; | |
| 17 | + include acym_getPartial('editor', 'default_template'); | |
| 12 | 18 | } |