Task #55009

Epic #55575: Streamline JavaScript Code in the TYPO3 Backend

Replace $GLOBALS['LANG']->JScharCode() with \TYPO3\CMS\Core\Utility\GeneralUtility::encodeJavaScriptString()

Added by Michiel Roos over 1 year ago. Updated over 1 year ago.

Status:Resolved Start date:2014-01-15
Priority:Should have Due date:
Assigned To:- % Done:

100%

Category:- Spent time: -
Target version:6.2.0
TYPO3 Version:6.2 Complexity:easy
PHP Version:5.3 Sprint Focus:

Description

The expensive JScharCode() calls (many calls to substr(), chr() and ord()) can be replaced with calls to \TYPO3\CMS\Core\Utility\GeneralUtility::encodeJavaScriptString()

Take care to add quotes around the result.


Related issues

follows Core - Task #54560: Replace JavaScriptEncoder with json_encode() Resolved 2013-12-22

Associated revisions

Revision 006a2e1f
Added by Michiel Roos over 1 year ago

[CLEANUP] $LANG->JScharCode() => quoteJSvalue()

Replace JscharCode() with GeneralUtility::quoteJSvalue()

Instead of making JavaScript use a String.fromCharCode, it will now use
a sanitized quoted string.

Change-Id: Idf81d5524d4bbb60b515670aa13648aa52064905
Resolves: #55009
Releases: 6.2
Reviewed-on: https://review.typo3.org/27380
Reviewed-by: Markus Klein
Tested-by: Markus Klein
Reviewed-by: Michiel Roos
Tested-by: Michiel Roos
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind

History

#2 Updated by Daniel Siepmann over 1 year ago

  • Parent task set to #55575

#3 Updated by Gerrit Code Review over 1 year 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/27380

#4 Updated by Gerrit Code Review over 1 year 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/27380

#5 Updated by Gerrit Code Review over 1 year ago

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

#6 Updated by Gerrit Code Review over 1 year ago

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

#7 Updated by Gerrit Code Review over 1 year ago

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

#8 Updated by Michiel Roos over 1 year ago

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

Also available in: Atom PDF