Skip to content

Commit 1686981

Browse files
committed
fix(security): add missing CSP nonce to theme_editor.php and make inline style conditional
- Add CSP nonce to script tag in theme_editor.php (Issue #459) - Make inline style attribute on headline conditional based on outputowncss setting (Issue #458) - Inline style is now only output when custom CSS is not enabled - Aligns with behavior of style block which is also conditional
1 parent 24a4349 commit 1686981

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

fragments/ConsentManager/box.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
<?php endif; ?>
7878
<div class="consent_manager-wrapper" id="consent_manager-wrapper" tabindex="-1" role="dialog" aria-modal="true" aria-labelledby="consent_manager-headline">
7979
<div class="consent_manager-header">
80-
<p class="consent_manager-headline" id="consent_manager-headline" style="margin:0; font-weight:bold; color: inherit;"><?= $consent_manager->texts['headline'] ?></p>
80+
<p class="consent_manager-headline" id="consent_manager-headline"<?php if ('' === $cssFrameworkMode && false === $addon->getConfig('outputowncss', false)) : ?> style="margin:0; font-weight:bold; color: inherit;"<?php endif; ?>><?= $consent_manager->texts['headline'] ?></p>
8181
<button class="consent_manager-close" aria-label="Close" type="button">×</button>
8282
</div>
8383
<div class="consent_manager-wrapper-inner">

fragments/ConsentManager/theme_editor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ class="btn <?= $themeBase === $key ? 'btn-primary' : 'btn-default' ?>">
589589
}
590590
</style>
591591

592-
<script>
592+
<script nonce="<?= rex_response::getNonce() ?>">
593593
(function() {
594594
'use strict';
595595

0 commit comments

Comments
 (0)