Skip to content

Commit

Permalink
fix: added missing conversion to HTML entities
Browse files Browse the repository at this point in the history
  • Loading branch information
thorsten committed Jan 27, 2023
1 parent 47480b3 commit ce676eb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
11 changes: 6 additions & 5 deletions phpmyfaq/admin/report.view.php
Expand Up @@ -20,6 +20,7 @@

use phpMyFAQ\Filter;
use phpMyFAQ\Report;
use phpMyFAQ\Strings;

if (!defined('IS_VALID_PHPMYFAQ')) {
http_response_code(400);
Expand Down Expand Up @@ -80,12 +81,12 @@
if (0 != $data['category_parent']) {
printf('<td>%s</td>', $data['category_parent']);
} else {
printf('<td>%s</td>', $data['category_name']);
printf('<td>%s</td>', Strings::htmlentities($data['category_name'] ?? ''));
}
}
if ($useSubcategory) {
if (0 != $data['category_parent']) {
printf('<td>%s</td>', $data['category_name']);
printf('<td>%s</td>', Strings::htmlentities($data['category_name']));
} else {
echo '<td>n/a</td>';
}
Expand All @@ -103,16 +104,16 @@
printf('<td>%s</td>', $data['faq_sticky']);
}
if ($useTitle) {
printf('<td>%s</td>', $data['faq_question']);
printf('<td>%s</td>', Strings::htmlentities($data['faq_question']));
}
if ($useCreationDate) {
printf('<td>%s</td>', $data['faq_updated']);
}
if ($useOwner) {
printf('<td>%s</td>', $data['faq_org_author']);
printf('<td>%s</td>', Strings::htmlentities($data['faq_org_author']));
}
if ($useLastModified) {
printf('<td>%s</td>', $data['faq_last_author']);
printf('<td>%s</td>', Strings::htmlentities($data['faq_last_author'] ?? ''));
}
if ($useUrl) {
$url = sprintf(
Expand Down
4 changes: 1 addition & 3 deletions phpmyfaq/src/phpMyFAQ/Report.php
Expand Up @@ -145,8 +145,6 @@ public function convertEncoding(string $outputString = ''): string
}

$toBeRemoved = ['=', '+', '-', 'HYPERLINK'];
$outputString = str_replace($toBeRemoved, '', $outputString);

return $outputString;
return str_replace($toBeRemoved, '', $outputString);
}
}

0 comments on commit ce676eb

Please sign in to comment.