Skip to content

Commit

Permalink
Not encode content from closure in data column
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik committed Nov 27, 2023
1 parent 6abf7de commit c8fdd6a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Column/DataColumnRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Yiisoft\Arrays\ArrayHelper;
use Yiisoft\Data\Paginator\OffsetPaginator;
use Yiisoft\Data\Paginator\PaginatorInterface;
use Yiisoft\Html\Html;
use Yiisoft\Html\Tag\Input;
use Yiisoft\Html\Tag\Select;
use Yiisoft\Yii\DataView\Column\Base\Cell;
Expand Down Expand Up @@ -92,14 +93,15 @@ public function renderBody(ColumnInterface $column, Cell $cell, DataContext $con
if ($contentSource !== null) {
$content = (string)(is_callable($contentSource) ? $contentSource($context->data, $context) : $contentSource);
} elseif ($column->property !== null) {
$content = (string)ArrayHelper::getValue($context->data, $column->property);
$content = Html::encode((string)ArrayHelper::getValue($context->data, $column->property));
} else {
$content = '';
}

return $cell
->addAttributes($column->bodyAttributes)
->content($content);
->content($content)
->encode(false);
}

public function renderFooter(ColumnInterface $column, Cell $cell, GlobalContext $context): Cell
Expand Down

0 comments on commit c8fdd6a

Please sign in to comment.