use wcf\data\category\CategoryNode;
use wcf\data\category\CategoryNodeTree;
use wcf\system\category\CategoryHandler;
+use wcf\util\StringUtil;
/**
* Abstract implementation of a condition for selecting multiple categories.
$fieldElement = '<select name="'.$this->fieldName.'[]" id="'.$this->fieldName.'" multiple size="'.($categoryCount >= 10 ? 10 : $categoryCount).'">';
/** @var CategoryNode $categoryNode */
foreach ($categoryTree as $categoryNode) {
- $fieldElement .= "<option value=\"{$categoryNode->categoryID}\"".(in_array($categoryNode->categoryID, $this->fieldValue) ? ' selected' : '').">".str_repeat(" ", $categoryNode->getDepth() - 1).$categoryNode->getTitle()."</option>";
+ $fieldElement .= "<option value=\"{$categoryNode->categoryID}\"".(in_array($categoryNode->categoryID, $this->fieldValue) ? ' selected' : '').">".str_repeat(" ", $categoryNode->getDepth() - 1) . StringUtil::encodeHTML($categoryNode->getTitle()) . "</option>";
}
$fieldElement .= '</select>';
use wcf\system\exception\UserInputException;
use wcf\system\WCF;
use wcf\util\ArrayUtil;
+use wcf\util\StringUtil;
/**
* Abstract implementation of a condition with multi select options.
* @inheritDoc
*/
protected function getOptionCode($value, $label) {
- return '<option value="'.$value.'"'.(in_array($value, $this->fieldValue) ? ' selected' : '').'>'.WCF::getLanguage()->get($label).'</option>';
+ return '<option value="'.$value.'"'.(in_array($value, $this->fieldValue) ? ' selected' : '').'>' . StringUtil::encodeHTML(WCF::getLanguage()->get($label)) . '</option>';
}
/**
use wcf\data\condition\Condition;
use wcf\system\exception\UserInputException;
use wcf\system\WCF;
+use wcf\util\StringUtil;
/**
* Abstract implementation of a condition with select options.
* @return string
*/
protected function getOptGroupCode($label, array $options) {
- $html = '<optgroup label="'.$label.'">';
+ $html = '<optgroup label="' . StringUtil::encodeHTML($label) . '">';
foreach ($options as $key => $value) {
$html .= $this->getOptionCode($key, $value);
}
* @return string
*/
protected function getOptionCode($value, $label) {
- return '<option value="'.$value.'"'.($this->fieldValue == $value ? ' selected' : '').'>'.WCF::getLanguage()->get($label).'</option>';
+ return '<option value="'.$value.'"'.($this->fieldValue == $value ? ' selected' : '').'>' . StringUtil::encodeHTML(WCF::getLanguage()->get($label)) . '</option>';
}
/**
use wcf\system\exception\UserInputException;
use wcf\system\WCF;
use wcf\util\ArrayUtil;
+use wcf\util\StringUtil;
/**
* Condition implementation for all of the user groups a user has to be a member
$returnValue = "";
foreach ($userGroups as $userGroup) {
/** @noinspection PhpVariableVariableInspection */
- $returnValue .= "<label><input type=\"checkbox\" name=\"".$identifier."[]\" value=\"".$userGroup->groupID."\"".(in_array($userGroup->groupID, $this->$identifier) ? ' checked' : "")."> ".$userGroup->getName()."</label>";
+ $returnValue .= "<label><input type=\"checkbox\" name=\"".$identifier."[]\" value=\"".$userGroup->groupID."\"".(in_array($userGroup->groupID, $this->$identifier) ? ' checked' : "")."> " . StringUtil::encodeHTML($userGroup->getName()) . "</label>";
}
return $returnValue;
$data = unpack($format, $binaryData);
// Extract the properties
- $header['checksum'] = @octdec(trim($data['checksum']));
+ $header['checksum'] = octdec(trim($data['checksum']));
if ($header['checksum'] == $checksum) {
$header['filename'] = trim($data['filename']);
$header['mode'] = octdec(trim($data['mode']));