mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-11 12:11:19 +00:00
fix xss attack
This commit is contained in:
parent
a0df82c2e7
commit
dd13504fef
|
@ -3277,7 +3277,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
$content .= "<br />";
|
||||
foreach($categories as $category) {
|
||||
$color = substr(md5($category->getName()), 0, 6);
|
||||
$content .= "<span class=\"badge\" style=\"background-color: #".$color."; color: #".self::getContrastColor($color).";\">".$category->getName()."</span> ";
|
||||
$content .= "<span class=\"badge\" style=\"background-color: #".$color."; color: #".self::getContrastColor($color).";\">".htmlspecialchars($category->getName())."</span> ";
|
||||
}
|
||||
}
|
||||
if(!empty($extracontent['bottom_title']))
|
||||
|
|
|
@ -139,7 +139,7 @@ $(document).ready( function() {
|
|||
if(!$nodocumentformfields || !in_array('categories', $nodocumentformfields)) {
|
||||
$options = array();
|
||||
foreach($categories as $category) {
|
||||
$options[] = array($category->getID(), $category->getName(), in_array($category, $document->getCategories()));
|
||||
$options[] = array($category->getID(), htmlspecialchars($category->getName()), in_array($category, $document->getCategories()));
|
||||
}
|
||||
$this->formField(
|
||||
getMLText("categories"),
|
||||
|
|
|
@ -369,9 +369,9 @@ $(document).ready(function() {
|
|||
}
|
||||
}
|
||||
if($removecategory) {
|
||||
$this->setParam('batchmsg', getMLText('batch_remove_category_msg', ['count'=>$j, 'catname'=>$changecategory->getName()]));
|
||||
$this->setParam('batchmsg', getMLText('batch_remove_category_msg', ['count'=>$j, 'catname'=>htmlspecialchars($changecategory->getName())]));
|
||||
} else {
|
||||
$this->setParam('batchmsg', getMLText('batch_add_category_msg', ['count'=>$j, 'catname'=>$changecategory->getName()]));
|
||||
$this->setParam('batchmsg', getMLText('batch_add_category_msg', ['count'=>$j, 'catname'=>htmlspecialchars($changecategory->getName())]));
|
||||
}
|
||||
} else {
|
||||
}
|
||||
|
@ -710,7 +710,7 @@ $(document).ready(function() {
|
|||
$allcategories = $dms->getDocumentCategories();
|
||||
if($allcategories) {
|
||||
foreach($allcategories as $acategory) {
|
||||
$options[] = array($acategory->getID(), $acategory->getName(), in_array($acategory->getId(), $tmpcatids));
|
||||
$options[] = array($acategory->getID(), htmlspecialchars($acategory->getName()), in_array($acategory->getId(), $tmpcatids));
|
||||
}
|
||||
$this->formField(
|
||||
getMLText("categories"),
|
||||
|
@ -947,7 +947,7 @@ $(document).ready(function() {
|
|||
$options = array();
|
||||
$allcategories = $dms->getDocumentCategories();
|
||||
foreach($allcategories as $acategory) {
|
||||
$options[] = array($acategory->getID(), $acategory->getName(), in_array($acategory->getId(), $tmpcatids));
|
||||
$options[] = array($acategory->getID(), htmlspecialchars($acategory->getName()), in_array($acategory->getId(), $tmpcatids));
|
||||
}
|
||||
$this->formField(
|
||||
getMLText("category_filter"),
|
||||
|
|
|
@ -3326,7 +3326,7 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
$content .= "<br />";
|
||||
foreach($categories as $category) {
|
||||
$color = substr(md5($category->getName()), 0, 6);
|
||||
$content .= "<span class=\"badge\" style=\"background-color: #".$color."; color: #".self::getContrastColor($color).";\">".$category->getName()."</span> ";
|
||||
$content .= "<span class=\"badge\" style=\"background-color: #".$color."; color: #".self::getContrastColor($color).";\">".htmlspecialchars($category->getName())."</span> ";
|
||||
}
|
||||
}
|
||||
if(!empty($extracontent['bottom_title']))
|
||||
|
|
Loading…
Reference in New Issue
Block a user