Actions
Bug #67757
closedSanity check is missing within MediaContentObject
Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Frontend
Target version:
-
Start date:
2015-06-25
Due date:
% Done:
100%
Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:
Description
In the file MediaContentObject.php Line 299 and Line 301 there are the sanity checks missing, which will trigger an PHP warning, which will produce an error.
https://typo3.org/api/typo3cms/_media_content_object_8php_source.html#l00299
https://typo3.org/api/typo3cms/_media_content_object_8php_source.html#l00301
The function explanation itself tells it will lookup the keys and if not present will use the defaults. <https://typo3.org/api/typo3cms/class_t_y_p_o3_1_1_c_m_s_1_1_frontend_1_1_content_object_1_1_media_content_object.html#a680af7dc67ac0db3435f864aea3f05e5>
But it does not really checks for presence. It just assumes.
Original:
295 protected function doFlexFormOverlay(array &$confArray, $key, $sectionKey = NULL) { 296 $flexValue = NULL; 297 $flexKey = 'mm' . ucfirst($key); 298 if ($sectionKey === NULL) { 299 $flexValue = $confArray['parameter.'][$flexKey]; 300 } else { 301 $flexValue = $confArray['parameter.'][$flexKey][$sectionKey]; 302 } 303 if ($flexValue === NULL) { 304 $flexValue = isset($confArray[$key . '.']) ? $this->cObj->stdWrap($confArray[$key], $confArray[$key . '.']) : $confArray[$key]; 305 } 306 return $flexValue; 307 } 308
Changed:
protected function doFlexFormOverlay(array &$confArray, $key, $sectionKey = NULL) { $flexValue = NULL; $flexKey = 'mm' . ucfirst($key); if ($sectionKey === NULL) { if (is_array($confArray['parameter.'])) $flexValue = $confArray['parameter.'][$flexKey]; } else { if (is_array($confArray['parameter.']) && is_array($flexValue = $confArray['parameter.'][$flexKey])) $flexValue = $confArray['parameter.'][$flexKey][$sectionKey]; } if ($flexValue === NULL) { $flexValue = isset($confArray[$key . '.']) ? $this->cObj->stdWrap($confArray[$key], $confArray[$key . '.']) : $confArray[$key]; } return $flexValue; }
Actions