BUGFIX] Illegal string offset
authorJigal van Hemert <jigal@xs4all.nl>
Mon, 28 May 2012 20:36:43 +0000 (22:36 +0200)
committerJigal van Hemert <jigal@xs4all.nl>
Mon, 28 May 2012 20:37:47 +0000 (22:37 +0200)
Check if parameter is an array before using it as an array in
getPagePath() and getPageInfo()

Change-Id: I96cbdcc5e6677d980100f53a76a74b3cb13e1068
Fixes: #37553
Releases: 6.0, 4.7, 4.6, 4.5
Reviewed-on: http://review.typo3.org/11668
Reviewed-by: Jigal van Hemert
Tested-by: Jigal van Hemert
typo3/template.php

index d67b98e..54988ab 100644 (file)
@@ -2093,7 +2093,7 @@ $str.=$this->docBodyTagBegin().
         */
        protected function getPagePath($pageRecord) {
                        // Is this a real page
-               if ($pageRecord['uid']) {
+               if (is_array($pageRecord) && $pageRecord['uid'])        {
                        $title = substr($pageRecord['_thePathFull'], 0, -1);
                                // remove current page title
                        $pos = strrpos($title, '/');
@@ -2128,7 +2128,7 @@ $str.=$this->docBodyTagBegin().
        protected function getPageInfo($pageRecord) {
                global $BE_USER;
                                // Add icon with clickmenu, etc:
-               if ($pageRecord['uid']) {       // If there IS a real page
+               if (is_array($pageRecord) && $pageRecord['uid'])        {       // If there IS a real page
                        $alttext = t3lib_BEfunc::getRecordIconAltText($pageRecord, 'pages');
                        $iconImg = t3lib_iconWorks::getSpriteIconForRecord('pages', $pageRecord, array('title'=>$alttext));
                                // Make Icon: