Commit a9d71f91 authored by Carsten  Rose's avatar Carsten Rose
Browse files

FE.type='annotate': a) always save with encode='none' (upto 30% less size than...

FE.type='annotate': a) always save with encode='none' (upto 30% less size than htmlspecialchar), b) Check fabric data for valid JSON read from database.
parent bf238262
......@@ -2832,6 +2832,10 @@ abstract class AbstractBuildForm {
}
}
if (!empty($value) && json_decode($value) === null) {
throw new UserFormException("Fabric data: JSON structure not valid", ERROR_BROKEN_JSON_STRUCTURE);
}
// $attributeImage = Support::doAttribute('id', 'qfq-fabric-image-1');
// $attributeImage .= Support::doAttribute('src', $this->fileToSipUrl($formElement[FE_IMAGE_SOURCE]));
// $attributeImage .= Support::doAttribute('class', 'qfq-fabric-image');
......
......@@ -137,7 +137,7 @@ const ERROR_CHECKBOX_EQUAL = 1026;
const ERROR_MISSING_ITEM_LIST = 1027;
const ERROR_UNKNOWN_FORM_RENDER = 1028;
const ERROR_NAME_LABEL_EMPTY = 1029;
const ERROR_BROKEN_JSON_STRUCTURE = 1030;
const ERROR_DEBUG = 1031;
const ERROR_UNKNOWN_MODE = 1032;
const ERROR_NOT_IMPLEMENTED = 1033;
......
......@@ -12,7 +12,6 @@ use qfq;
require_once(__DIR__ . '/../../qfq/helper/Sanitize.php');
class Client {
public static function getParam() {
......@@ -29,6 +28,7 @@ class Client {
if (isset($_POST)) {
$post = $_POST;
// Logger::logMessage(var_export($post, true) . PHP_EOL . PHP_EOL,'post.txt');
}
if (isset($_COOKIE[SESSION_NAME])) {
......
......@@ -12,6 +12,7 @@ require_once(__DIR__ . '/Store.php');
require_once(__DIR__ . '/../database/Database.php');
require_once(__DIR__ . '/../Constants.php');
require_once(__DIR__ . '/../helper/HelperFormElement.php');
require_once(__DIR__ . '/../helper/Logger.php');
require_once(__DIR__ . '/../exceptions/UserFormException.php');
class FillStoreForm {
......@@ -56,7 +57,6 @@ class FillStoreForm {
$this->dbArray[$this->dbIndexQfq] = new Database($this->dbIndexQfq);
}
$this->feSpecNative = $this->loadFormElementsBasedOnSIP();
$this->evaluate = new Evaluate($this->store, $this->dbArray[$this->dbIndexData]);
......@@ -219,12 +219,19 @@ class FillStoreForm {
continue;
}
switch ($formElement[FE_TYPE]) {
case FE_TYPE_CHECKBOX:
// Checkbox Multi: collect values
if ($formElement[FE_TYPE] === 'checkbox') {
$val = $this->collectMultiValues($clientFieldName, $clientValues);
if ($val !== false) {
$clientValues[$clientFieldName] = $val;
}
break;
case FE_TYPE_ANNOTATE:
$formElement[FE_ENCODE] = FE_ENCODE_NONE;
break;
default:
break;
}
if ($formElement[FE_MODE] === FE_MODE_REQUIRED) {
......@@ -272,6 +279,7 @@ class FillStoreForm {
}
$this->store->setStore($newValues, STORE_FORM, true);
}
/**
......
Markdown is supported
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