| @@ -1,5 +1,7 @@ | ||
| 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 | |
| 3 | 5 | use AcyMailing\Classes\TagClass; |
| 4 | 6 | |
| 5 | 7 | if (empty($data['mailInformation'])) { |
| @@ -14,11 +16,12 @@ | ||
| 14 | 16 | <div class="cell acym__wysid__edit__versions-<?php echo $isAbTest ? 'abtest' : 'multilingual'; ?>" id="acym__wysid__edit__versions"> |
| 15 | 17 | <div class="acym__title acym__title__secondary"> |
| 16 | 18 | <?php |
| 17 | 19 | if ($isAbTest) { |
| 18 | - echo acym_translation('ACYM_VERSIONS'); | |
| 20 | + echo esc_html(acym_translation('ACYM_VERSIONS')); | |
| 19 | 21 | } else { |
| 20 | - echo acym_translation('ACYM_CONFIGURATION_LANGUAGES').acym_info(['textShownInTooltip' => 'ACYM_MULTILINGUAL_DESC']); | |
| 22 | + echo esc_html(acym_translation('ACYM_CONFIGURATION_LANGUAGES')); | |
| 23 | + acym_info(['textShownInTooltip' => 'ACYM_MULTILINGUAL_DESC']); | |
| 21 | 24 | } ?> |
| 22 | 25 | </div> |
| 23 | 26 | |
| 24 | 27 | <div class="acym__wysid__edit__versions__selection acym__wysid__edit__versions-selected"> |
| @@ -25,11 +28,11 @@ | ||
| 25 | 28 | <?php |
| 26 | 29 | if ($isAbTest) { |
| 27 | 30 | echo '<i class="acymicon-pencil acym__wysid__edit__versions__selection__edition"></i> |
| 28 | 31 | <i class="acymicon-check acym__wysid__edit__versions__selection__check"></i> |
| 29 | - <span class="acym__wysid__edit__versions__selection__element" acym-data-version="main">'.$data['main_version']->name.'</span>'; | |
| 32 | + <span class="acym__wysid__edit__versions__selection__element" acym-data-version="main">'.esc_html($data['main_version']->name).'</span>'; | |
| 30 | 33 | } else { |
| 31 | - echo acym_tooltip( | |
| 34 | + acym_tooltip( | |
| 32 | 35 | [ |
| 33 | 36 | 'hoveredText' => '<i class="acymicon-pencil acym__wysid__edit__versions__selection__edition"></i> |
| 34 | 37 | <i class="acymicon-check acym__wysid__edit__versions__selection__check"></i> |
| 35 | 38 | <img |
| @@ -47,9 +50,9 @@ | ||
| 47 | 50 | <?php |
| 48 | 51 | $code = $isAbTest ? $data['main_version']->name : $data['main_language']->code; |
| 49 | 52 | ?> |
| 50 | 53 | <?php if (!$isAbTest) { ?> |
| 51 | - <input type="hidden" name="mail[language]" value="<?php echo acym_escape($code); ?>"> | |
| 54 | + <input type="hidden" name="mail[language]" value="<?php echo esc_attr($code); ?>"> | |
| 52 | 55 | <?php } ?> |
| 53 | 56 | <input type="hidden" name="versions[main][subject]" value=""> |
| 54 | 57 | <input type="hidden" name="versions[main][preview]" value=""> |
| 55 | 58 | <input type="hidden" name="versions[main][content]" value=""> |
| @@ -68,16 +71,18 @@ | ||
| 68 | 71 | } |
| 69 | 72 | ?> |
| 70 | 73 | |
| 71 | 74 | <div class="acym__wysid__edit__versions__separator"></div> |
| 72 | - <div class="<?php echo $containerClass; ?>"> | |
| 75 | + <div class="<?php echo esc_attr($containerClass); ?>"> | |
| 73 | 76 | <?php |
| 74 | 77 | if ($isAbTest) { |
| 75 | 78 | echo '<i class="acymicon-pencil acym__wysid__edit__versions__selection__edition"></i> |
| 76 | 79 | <i class="acymicon-check acym__wysid__edit__versions__selection__check"></i> |
| 77 | - <span class="acym__wysid__edit__versions__selection__element" acym-data-version="'.$version->code.'">'.$version->name.'</span>'; | |
| 80 | + <span class="acym__wysid__edit__versions__selection__element" acym-data-version="'.esc_attr($version->code).'">'.esc_html( | |
| 81 | + $version->name | |
| 82 | + ).'</span>'; | |
| 78 | 83 | } else { |
| 79 | - echo acym_tooltip( | |
| 84 | + acym_tooltip( | |
| 80 | 85 | [ |
| 81 | 86 | 'hoveredText' => '<i class="acymicon-pencil acym__wysid__edit__versions__selection__edition"></i> |
| 82 | 87 | <i class="acymicon-check acym__wysid__edit__versions__selection__check"></i> |
| 83 | 88 | <img |
| @@ -90,14 +95,14 @@ | ||
| 90 | 95 | ); |
| 91 | 96 | } |
| 92 | 97 | ?> |
| 93 | 98 | |
| 94 | - <input type="hidden" name="versions[<?php echo $version->code; ?>][subject]" value="<?php echo acym_escape($version->subject); ?>"> | |
| 95 | - <input type="hidden" name="versions[<?php echo $version->code; ?>][preview]" value="<?php echo acym_escape($version->preview); ?>"> | |
| 96 | - <input type="hidden" name="versions[<?php echo $version->code; ?>][content]" value="<?php echo acym_escape($version->content); ?>"> | |
| 97 | - <input type="hidden" name="versions[<?php echo $version->code; ?>][autosave]" value="<?php echo acym_escape($version->autosave); ?>"> | |
| 98 | - <input type="hidden" name="versions[<?php echo $version->code; ?>][settings]" value="<?php echo acym_escape($version->settings); ?>"> | |
| 99 | - <input type="hidden" name="versions[<?php echo $version->code; ?>][stylesheet]" value="<?php echo acym_escape($version->stylesheet); ?>"> | |
| 99 | + <input type="hidden" name="versions[<?php echo esc_attr($version->code); ?>][subject]" value="<?php echo esc_attr($version->subject); ?>"> | |
| 100 | + <input type="hidden" name="versions[<?php echo esc_attr($version->code); ?>][preview]" value="<?php echo esc_attr($version->preview); ?>"> | |
| 101 | + <input type="hidden" name="versions[<?php echo esc_attr($version->code); ?>][content]" value="<?php echo esc_attr($version->content); ?>"> | |
| 102 | + <input type="hidden" name="versions[<?php echo esc_attr($version->code); ?>][autosave]" value="<?php echo esc_attr($version->autosave); ?>"> | |
| 103 | + <input type="hidden" name="versions[<?php echo esc_attr($version->code); ?>][settings]" value="<?php echo esc_attr($version->settings); ?>"> | |
| 104 | + <input type="hidden" name="versions[<?php echo esc_attr($version->code); ?>][stylesheet]" value="<?php echo esc_attr($version->stylesheet); ?>"> | |
| 100 | 105 | </div> |
| 101 | 106 | <?php |
| 102 | 107 | } |
| 103 | 108 | ?> |
| @@ -103,27 +108,27 @@ | ||
| 103 | 108 | ?> |
| 104 | 109 | </div> |
| 105 | 110 | |
| 106 | 111 | <div id="acym__wysid__edit__versions__creation" class="cell grid-x grid-margin-x text-center align-center is-hidden"> |
| 107 | - <h5><?php echo acym_translation($isAbTest ? 'ACYM_VERSION_CREATION_TITLE' : 'ACYM_MULTILINGUAL_CREATION_TITLE'); ?></h5> | |
| 108 | - <div class="cell"><?php echo acym_translation($isAbTest ? 'ACYM_VERSION_CREATION_DESCRIPTION' : 'ACYM_MULTILINGUAL_CREATION_DESCRIPTION'); ?></div> | |
| 112 | + <h5><?php echo esc_html(acym_translation($isAbTest ? 'ACYM_VERSION_CREATION_TITLE' : 'ACYM_MULTILINGUAL_CREATION_TITLE')); ?></h5> | |
| 113 | + <div class="cell"><?php echo esc_html(acym_translation($isAbTest ? 'ACYM_VERSION_CREATION_DESCRIPTION' : 'ACYM_MULTILINGUAL_CREATION_DESCRIPTION')); ?></div> | |
| 109 | 114 | <button type="button" class="cell button xlarge-4 large-4 margin-top-1 button-secondary" id="acym__wysid__edit__versions__creation__default"> |
| 110 | - <?php echo acym_translation('ACYM_MULTILINGUAL_CREATION_FROM_DEFAULT'); ?> | |
| 115 | + <?php echo esc_html(acym_translation('ACYM_MULTILINGUAL_CREATION_FROM_DEFAULT')); ?> | |
| 111 | 116 | </button> |
| 112 | 117 | <button type="button" class="cell button xlarge-4 large-4 margin-top-1 button-secondary" id="acym__wysid__edit__versions__creation__scratch"> |
| 113 | - <?php echo acym_translation('ACYM_MULTILINGUAL_CREATION_FROM_SCRATCH'); ?> | |
| 118 | + <?php echo esc_html(acym_translation('ACYM_MULTILINGUAL_CREATION_FROM_SCRATCH')); ?> | |
| 114 | 119 | </button> |
| 115 | 120 | <button type="button" |
| 116 | - data-open="acym__template__choose__modal" | |
| 117 | - aria-controls="acym__template__choose__modal" | |
| 118 | - tabindex="0" | |
| 119 | - aria-haspopup="true" | |
| 120 | - class="cell button xlarge-4 large-4 margin-top-1 button-secondary"> | |
| 121 | - <?php echo acym_translation('ACYM_START_FROM_TEMPLATE'); ?> | |
| 121 | + data-open="acym__template__choose__modal" | |
| 122 | + aria-controls="acym__template__choose__modal" | |
| 123 | + tabindex="0" | |
| 124 | + aria-haspopup="true" | |
| 125 | + class="cell button xlarge-4 large-4 margin-top-1 button-secondary"> | |
| 126 | + <?php echo esc_html(acym_translation('ACYM_START_FROM_TEMPLATE')); ?> | |
| 122 | 127 | </button> |
| 123 | 128 | <?php |
| 124 | 129 | $dataForTemplate = ['allTags' => $data['tagClass']->getAllTagsByType(TagClass::TYPE_MAIL)]; |
| 125 | - echo acym_modalInclude( | |
| 130 | + acym_modalInclude( | |
| 126 | 131 | '', |
| 127 | 132 | ACYM_VIEW.'Mails'.DS.'tmpl'.DS.'choose_template_ajax.php', |
| 128 | 133 | 'acym__template__choose__modal', |
| 129 | 134 | $dataForTemplate, |