Skip to content

Commit

Permalink
Use StyleWithNonce element
Browse files Browse the repository at this point in the history
  • Loading branch information
sukhwinder33445 authored and nilmerg committed Sep 8, 2023
1 parent fa4f719 commit f8cb537
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions library/X509/ExpirationWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@
namespace Icinga\Module\X509;

use Icinga\Date\DateFormatter;
use Icinga\Util\Csp;
use ipl\Html\BaseHtmlElement;
use ipl\Html\Html;
use ipl\Html\HtmlString;
use ipl\Web\Style;
use ipl\Web\Compat\StyleWithNonce;

class ExpirationWidget extends BaseHtmlElement
{
Expand Down Expand Up @@ -71,9 +70,8 @@ protected function assemble()
}

$progressBar = Html::tag('div', ['class' => "bg-stateful $state"], new HtmlString(' '));
$progressBarStyle = (new Style())
$progressBarStyle = (new StyleWithNonce())
->setModule('x509')
->setNonce(Csp::getStyleNonce())
->addFor($progressBar, ['width' => sprintf('%F%%', $ratio)]);

$this->addHtml(Html::tag('span', ['class' => 'progress-bar-label', 'title' => $dateTip], $message));
Expand Down

0 comments on commit f8cb537

Please sign in to comment.