[TYPO3-core] RFC: Bug 1030, 277, 1472 possibly 1270

René Fritz rene at typo3.org
Sat Feb 25 01:28:21 CET 2006


> René Fritz wrote:
> > So just leave it as it is. All is fine!
>
> Ok. I'm fine. But just because I'm curios also:
>
> +	function quoteJSvalue($value, $inScriptTags = false)	{
> +		$value = addcslashes($value, '\''.chr(10).chr(13));
> +		if (!$inScriptTags)	{
> +			$value = htmlspecialchars($value);
> +		}
>
> where is here a "double" negation ?

I call it so because ...

The parameter $inScriptTags is set to false by default 
but for the test it will be negated 
and therefore if false the value will be processed (hsc)

From the naming I would expect that the function don't perform a special 
action when the parameter is set to false, but the opposite is the case.

Additionally you may need the function for onclick JS code but without 
htmlspecialchars() which means you have to set $inScriptTags = true while the 
code is just for onclick.

All confused now :-)

Enough for today
Good night
René

-- 
René Fritz
TYPO3 Association - Active Member
http://association.typo3.org/



More information about the TYPO3-team-core mailing list