[TYPO3-project-formidable] FORMIdable & XHTML

Manuel Rego Casasnovas mrego at igalia.com
Wed Jul 4 09:57:51 CEST 2007


Hello,

another issue related with XHTML validation, if you're going to show
some data that has been inserted by an user you have to escape the
special chars, if you don't do this you can have problems with the XHTML
validation.
For example when a user put "&" in an text input.

I think that the better solution for this is change the
_getHumanReadableValue at line 502 in mainrenderlet class
(http://test.kunstvaerker.dk/html/class_8mainrenderlet_8php-source.html#l00502).

I've thought in two options:
   - 1)
        function _getHumanReadableValue($data) {
            return htmlspecialchars($data);
        }

   - 2)
        function _getHumanReadableValue($data) {
            if ($this->oForm->_defaultTrue("/htmlspecialchars/",
$this->aElement)) {
                return htmlspecialchars($data);
            }
            return $data;
        }

I think that if FORMidable wants to be XHTML valid the first, is the
better option.
I don't know if the second option have or not sense. The second option
allows to the user to don't escape the special chars, but I don't know
if somebody would use this option.

What is your option? What option do you prefer?

Best regards,
   Rego

-- 
Manuel Rego Casasnovas
Computer Science Engineer
mailto:mrego at igalia.com
Tel: +34 986 10 76 10
Fax: +34 981 91 39 49
Igalia - http://www.igalia.com


More information about the TYPO3-project-formidable mailing list