at all, a pasted picture's * data: address, a colour or an alignment (style=) each block the post, and a few in a short * while ban whoever sent them. A reply's draft, saved a moment after typing stops, sent it * again and again. * * So the browser (js/http.js) sends what an editor holds - each rich-text editor's and Markdown * box's field, and anything itflowPost() sends that looks like HTML - as one JSON file beside * the form, itflow_fields[0], [1]... (split to fit upload_max_filesize), which a firewall * doesn't read as fields. requestFieldsRestore() puts the fields back into $_POST before * anything reads them, so every page and handler gets what was written as it always has, and * ITFlow cleans it as it always has (HTMLPurifier). The file: * * {"v": 1, "fields": [["ticket_reply", "

...

"], ["items[3][description]", "..."], ...]} * * Field names are posted names - brackets and all - and read as PHP reads a posted form. */ const REQUEST_FIELDS_FILE = 'itflow_fields'; /** A php.ini size - 8M, 512K, 2G - in bytes. */ function requestIniBytes($value) { $value = trim((string) $value); $number = intval($value); switch (strtolower(substr($value, -1))) { case 'g': return $number * 1024 * 1024 * 1024; case 'm': return $number * 1024 * 1024; case 'k': return $number * 1024; } return $number; } /* * What the browser can send as files, for js/http.js's