Skip to content

SPIN-5582: Strip html from database values. Keep html in specific renderer output. - #33

Open
bartleenheer wants to merge 4 commits into
4.xfrom
SPIN-5582
Open

SPIN-5582: Strip html from database values. Keep html in specific renderer output.#33
bartleenheer wants to merge 4 commits into
4.xfrom
SPIN-5582

Conversation

@bartleenheer

Copy link
Copy Markdown

No description provided.

@bartleenheer bartleenheer left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look if we can reduce the amount of nested for-loops

Comment thread Util/Datatable.php
Comment on lines +226 to +239
private function _markRendererOutputAsSafe(array &$data, array $raw_data)
{
foreach ($data as $row_index => &$row)
{
foreach ($row as $column_index => &$value)
{
$original = $raw_data[$row_index][$column_index] ?? null;
if (is_string($value) && $value !== $original)
{
$value = new Markup($value, 'UTF-8');
}
}
}
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Foreach -> foreach

Comment thread Util/Datatable.php Outdated
Comment on lines +254 to +266
private function _escapeUnsafeValues(array &$data)
{
foreach ($data as &$row)
{
foreach ($row as &$value)
{
if (is_string($value))
{
$value = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
}
}
}
}

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Foreach -> foreach

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant