Fixed bug #16902: Fatal error in tslib_content_text (Thanks to Jo Hasenau)
authornxpthx <nxpthx@709f56b5-9817-0410-a4d7-c38de5d9e867>
Tue, 22 Feb 2011 16:16:46 +0000 (16:16 +0000)
committernxpthx <nxpthx@709f56b5-9817-0410-a4d7-c38de5d9e867>
Tue, 22 Feb 2011 16:16:46 +0000 (16:16 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10535 709f56b5-9817-0410-a4d7-c38de5d9e867

ChangeLog
typo3/sysext/cms/tslib/content/class.tslib_content_image.php
typo3/sysext/cms/tslib/content/class.tslib_content_phpscriptinternal.php
typo3/sysext/cms/tslib/content/class.tslib_content_text.php

index e690b36..4f47142 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
 2011-02-22  Steffen Ritter  <info@steffen-ritter.net>
 
        * Fixed bug #16891: showpic.php causes a fatal error if parameters GET variable is not an array (Thanks to Helmut Hummel)
+       * Fixed bug #16902: Fatal error in tslib_content_text (Thanks to Jo Hasenau)
 
 2011-02-22  Steffen Kamper  <steffen@typo3.org>
 
index 7dc959d..bc72fd7 100644 (file)
@@ -42,7 +42,7 @@ class tslib_content_Image extends tslib_content_Abstract {
         * @return      string          Output
         */
        public function render($conf = array()) {
-               if ($this->cObj->checkIf($conf['if.'])) {
+               if (isset($conf['if.']) && $this->cObj->checkIf($conf['if.'])) {
                        $theValue = $this->cObj->cImage($conf['file'], $conf);
                        if (isset($conf['stdWrap.'])) {
                                $theValue = $this->cObj->stdWrap($theValue, $conf['stdWrap.']);
index bf9a50b..2a02b4d 100644 (file)
@@ -42,6 +42,10 @@ class tslib_content_PhpScriptInternal extends tslib_content_Abstract {
         * @return      string          Output
         */
        public function render($conf = array()) {
+               if (!is_array($conf) || empty($conf['scriptSuffix'])) {
+                       throw new InvalidArgumentException('Expected parameter $conf[\'scriptSuffix\'] was not given.', 1295705938);
+               }
+
                $file = isset($conf['file.'])
                        ? $this->cObj->stdWrap($conf['file'], $conf['file.'])
                        : $conf['file'];
index 3bfdc78..866363b 100644 (file)
@@ -42,8 +42,11 @@ class tslib_content_Text extends tslib_content_Abstract {
         * @return      string          Output
         */
        public function render($conf = array()) {
-               $content = $conf['value'];
-               unset($conf['value']);
+               $content = '';
+               if (is_array($conf) && isset($conf['value'])) {
+                       $content = $conf['value'];
+                       unset($conf['value']);
+               }
                if(count($conf)) {
                        $content = $this->cObj->stdWrap($content, $conf);
                }