Feature #56642

Missing TypoScript property to quote and escape content for use in JavaScript

Added by Jigal van Hemert over 5 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Should have
Category:
TypoScript
Target version:
-
Start date:
2014-03-20
Due date:
% Done:

100%

PHP Version:
Tags:
Complexity:
easy
Sprint Focus:

Description

We have htmlSpecialChars and rawUrlEncode in stdWrap, but no equivalent of \TYPO3\CMS\Core\Utility\GeneralUtility::quoteJSvalue()


Subtasks

Task #57107: Rename escapeJsValue and make it context specificClosedJigal van Hemert

Associated revisions

Revision 27fc64a9 (diff)
Added by Jigal van Hemert over 5 years ago

[FEATURE] TypoScript property escapeJsValue

The stdWrap property escapeJsValue allows content to be
included in JavaScript strings.

Resolves: #56642
Documentation: #56665
Releases: 6.2
Change-Id: I43f59889caec1a89970b94c93c93894d589243c9
Reviewed-on: https://review.typo3.org/28177
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
Reviewed-by: Markus Klein
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert

History

#1 Updated by Jigal van Hemert over 5 years ago

Use case: JavaScript for a statistics tools needs to log some of the submitted data or one of the URL parameters. It's easy to build some TS that puts that data in a block of JS, but without proper escaping (and possibly quoting) a visitor can create XSS.

#2 Updated by Jigal van Hemert over 5 years ago

  • Assignee set to Jigal van Hemert

RM was asked and doesn't mind having it in 6.2LTS.

#3 Updated by Gerrit Code Review over 5 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/28177

#4 Updated by Gerrit Code Review over 5 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/28177

#5 Updated by Jigal van Hemert over 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#6 Updated by Benni Mack about 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF