Commit 68756afd authored by Carsten  Rose's avatar Carsten Rose
Browse files

Bug #4159 / missing htmlspecialchar_decode() for FE.value supplied content.

AbstractBuildForm.php: Removed some unused comments. Bug fix: do htmlspecialchar_decode() always when FE_ENCODE is set to encodeSpecialchar.
QuickFormQuery.php: mv necessary systemStoreUpdate() closer to instantiating of classs Store.
parent 5e52d4d5
......@@ -448,20 +448,8 @@ abstract class AbstractBuildForm {
if (is_array($formElement[FE_VALUE])) {
$formElement[FE_VALUE] = (count($formElement[FE_VALUE])) > 0 ? current($formElement[FE_VALUE][0]) : '';
}
// If is FormElement['value'] explicit defined: take it
// There are two options: a) single value, b) array of values (template Group)
// if (is_array($formElement[FE_VALUE])) {
// // For Templates Groups, the 'value' has to be defined as '{{!SELECT ...' wich returns all selected records in an array.
// $idx = isset($formElement[FE_TEMPLATE_GROUP_CURRENT_IDX]) ? $formElement[FE_TEMPLATE_GROUP_CURRENT_IDX] - 1 : 0;
// if (isset($formElement[FE_VALUE][$idx]) && is_array($formElement[FE_VALUE][$idx])) {
// $value = current($formElement[FE_VALUE][$idx]);
// if ($value === false) {
// $value = '';
// }
// }
// } else {
$value = $formElement[FE_VALUE];
// }
if ($value === '') {
// #2064 / Only take the default, if the FE is a real tablecolumn.
......@@ -471,9 +459,10 @@ abstract class AbstractBuildForm {
}
// Retrieve value via FSRVD
$value = $this->store->getVar($name, $storeUse, $formElement[FE_CHECK_TYPE], $foundInStore);
if ($foundInStore == STORE_RECORD && $formElement[FE_ENCODE] === FE_ENCODE_SPECIALCHAR) {
$value = htmlspecialchars_decode($value, ENT_QUOTES);
}
}
if ($formElement[FE_ENCODE] === FE_ENCODE_SPECIALCHAR) {
$value = htmlspecialchars_decode($value, ENT_QUOTES);
}
// Typically: $htmlElementNameIdZero = true
......
......@@ -148,9 +148,9 @@ class QuickFormQuery {
$bodytext = $this->t3data[T3DATA_BODYTEXT];
$this->store = Store::getInstance($bodytext, $phpUnit);
$this->store->systemStoreUpdate();
$this->store->setVar(TYPO3_TT_CONTENT_UID, $t3data[T3DATA_UID], STORE_TYPO3);
$this->db = new Database();
$this->store->systemStoreUpdate();
$this->eval = new Evaluate($this->store, $this->db);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment