Fixed bug #17371: Typo in MEDIA renders wrong height
authorSteffen Kamper <info@sk-typo3.de>
Sat, 29 Jan 2011 23:04:41 +0000 (23:04 +0000)
committerSteffen Kamper <info@sk-typo3.de>
Sat, 29 Jan 2011 23:04:41 +0000 (23:04 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/branches/TYPO3_4-5@10352 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/tslib/content/class.tslib_content_media.php

index faa7119..02e6ede 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-01-30  Steffen Kamper  <steffen@typo3.org>
+
+       * Fixed bug #17371: Typo in MEDIA renders wrong height
+
 2011-01-28  Jeff Segars  <jeff@webempoweredchurch.org>
 
        * Fixed bug #17372: stdWrap .current and .setContentToCurrent do not return content
index cee9082..802c4e3 100644 (file)
@@ -42,7 +42,7 @@ class tslib_content_Media extends tslib_content_Abstract {
         * @return      string          Output
         */
        public function render($conf = array()) {
-               $content = '';
+               $content = $mmFile = '';
                $flexParams = isset($conf['flexParams.'])
                        ? $this->cObj->stdWrap($conf['flexParams'], $conf['flexParams.'])
                        : $conf['flexParams'];
@@ -61,6 +61,7 @@ class tslib_content_Media extends tslib_content_Abstract {
                }
 
                $mode = is_file(PATH_site . $url) ? 'file' : 'url';
+               $fileinfo = NULL;
                if ($mode === 'file') {
                                // render FILE
                        $filename = $GLOBALS['TSFE']->tmpl->getFileName($url);
@@ -91,7 +92,7 @@ class tslib_content_Media extends tslib_content_Abstract {
                                // default renderType is swf
                        $renderType = 'swf';
                        $handler = array_keys($conf['fileExtHandler.']);
-                       if (in_array($fileinfo['fileext'], $handler)) {
+                       if (is_array($fileinfo) && in_array($fileinfo['fileext'], $handler)) {
                                $renderType = strtolower($conf['fileExtHandler.'][$fileinfo['fileext']]);
                        }
                }
@@ -137,12 +138,12 @@ class tslib_content_Media extends tslib_content_Abstract {
                } else {
                        $height = isset($conf['height.'])
                                ? intval($this->cObj->stdWrap($conf['height'], $conf['height.']))
-                               : intval($conf['width']);
+                               : intval($conf['height']);
                        $conf['height'] = $height ? $height : $typeConf['defaultHeight'];
                }
 
                if (is_array($conf['parameter.']['mmMediaOptions'])) {
-                       $params = array();
+                       $params = $parts = array();
                        foreach ($conf['parameter.']['mmMediaOptions'] as $key => $value) {
                                if ($key == 'mmMediaCustomParameterContainer') {
                                        foreach ($value as $val) {
@@ -191,7 +192,7 @@ class tslib_content_Media extends tslib_content_Abstract {
                        if ($url == '' && !$conf['allowEmptyUrl']) {
                                return '<p style="background-color: yellow;">' . $GLOBALS['TSFE']->sL('LLL:EXT:cms/locallang_ttc.xml:media.noFile', TRUE) . '</p>';
                        }
-                       $conf = array_merge($conf['mimeConf.']['swfobject.'], $conf);
+                       $conf = array_merge((array) $conf['mimeConf.']['swfobject.'], $conf);
                        $conf[$conf['type'] . '.']['player'] = strpos($url, '://') === FALSE ? 'http://' . $url : $url;
                        $conf['installUrl'] = 'null';
                        $conf['flashvars'] = array_merge((array) $conf['flashvars'], $conf['predefined']);
@@ -199,8 +200,8 @@ class tslib_content_Media extends tslib_content_Abstract {
 
                switch ($renderType) {
                        case 'swf' :
-                               $conf[$conf['type'] . '.'] = array_merge($conf['mimeConf.']['swfobject.'][$conf['type'] . '.'], $typeConf);
-                               $conf = array_merge($conf['mimeConf.']['swfobject.'], $conf);
+                               $conf[$conf['type'] . '.'] = array_merge((array) $conf['mimeConf.']['swfobject.'][$conf['type'] . '.'], $typeConf);
+                               $conf = array_merge((array) $conf['mimeConf.']['swfobject.'], $conf);
                                unset($conf['mimeConf.']);
                                $conf['flashvars.'] = array_merge((array) $conf['flashvars.'], $conf['predefined']);
                                $content = $this->cObj->SWFOBJECT($conf);