[BUGFIX] Allow attributes with = in cObj MEDIA 99/41699/4
authorGeorg Ringer <georg.ringer@gmail.com>
Sun, 19 Jul 2015 09:14:54 +0000 (11:14 +0200)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Sun, 16 Aug 2015 22:20:39 +0000 (00:20 +0200)
Set limit to 2 in trimExplode to make it possible to use '=' in the
value of a attribute.

Also URL encode flashvars values as per Flash documentation, see
https://helpx.adobe.com/flash/kb/pass-variables-swfs-flashvars.html

Change-Id: I8bebf1afd8ef521268306660129a035e429e5d31
Resolves: #25298
Releases: master
Reviewed-on: http://review.typo3.org/41699
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Daniel Goerz <ervaude@gmail.com>
Tested-by: Daniel Goerz <ervaude@gmail.com>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
typo3/sysext/mediace/Classes/ContentObject/MediaContentObject.php

index 226e375..6614dc1 100644 (file)
@@ -125,10 +125,10 @@ class MediaContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractConte
                                                                if ($tsLine[0] !== '#' && ($pos = strpos($tsLine, '.'))) {
                                                                        $parts[0] = substr($tsLine, 0, $pos);
                                                                        $parts[1] = substr($tsLine, $pos + 1);
-                                                                       $valueParts = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode('=', $parts[1], TRUE);
+                                                                       $valueParts = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode('=', $parts[1], TRUE, 2);
                                                                        switch (strtolower($parts[0])) {
                                                                                case 'flashvars':
-                                                                                       $conf['flashvars.'][$valueParts[0]] = $valueParts[1];
+                                                                                       $conf['flashvars.'][$valueParts[0]] = rawurlencode($valueParts[1]);
                                                                                        break;
                                                                                case 'params':
                                                                                        $conf['params.'][$valueParts[0]] = $valueParts[1];