Bug #67757
closedSanity check is missing within MediaContentObject
100%
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; }
Updated by Gerrit Code Review almost 9 years ago
- Status changed from New to Under Review
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/45112
Updated by Gerrit Code Review almost 9 years ago
Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/45112
Updated by Thilo Schumann almost 9 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 8f09bda54da21c8a8bdf07ed19ad4a9ec3b4b876.