Review main Merged

33191[BUGFIX] Fix PHP warning with CTYPE=media

Goran Medakovic CR +2 V +2 Easy +1 −1 updated 10/08/14, 21:38

Commit message

Check for array type before checking the variable with isset().
If the variable is a string the isset() will cause a PHP warning.

Review

  • Code review CR +2
    • Wouter Wolters +2
    • Markus Klein +1
  • Verified V +2
    • Wouter Wolters +2
    • Markus Klein +1

Issues 1

Files 1

Review log 15

  1. Goran Medakovic uploaded patch set 1 10/07/14, 16:38

  2. Markus Klein updated the commit message in patch set 2 10/07/14, 21:58

  3. Markus Klein commented on patch set 2 CR -1 V -1 10/07/14, 22:02

    The isset() check in the condition is only true if $flexData is an array.

    ContentObjectRenderer.php:1183

    if $flexData is now not an array anymore the following foreach will fail.

    ContentObjectRenderer.php:5280

    You removed and unrelated line.
  4. Goran Medakovic commented on patch set 2 10/08/14, 07:27

    I'm rather new to gerrit, I've added a comment about that line being mistakenly deleted but didn't review the changes and comment wasn't posted..

    ContentObjectRenderer.php:1183 Reply

    But in that case we are handling flexform which is not formated by the standard

    ContentObjectRenderer.php:5280 Reply

    Yes, that was a mistake, I didn't noticed but somehow my branched version differed from current Typo3 version on the server.. not sure how this happened
  5. Goran Medakovic commented on patch set 2 10/08/14, 07:37

    ContentObjectRenderer.php:1186

    Here is additional verification that prohibits wrong formats from being parsed, and there are other validations with isset further down the code.. In short words I didn't noticed any strange behavior with flexforms after this change and I'm using gridelements which are heavily dependent on flexforms.
  6. Markus Klein commented on patch set 2 10/08/14, 09:34

    ContentObjectRenderer.php:1183 Reply

    Ok, please post what $flexData looks like in your case here.

    ContentObjectRenderer.php:1186 Reply

    But the if you do not check $flexData being an array above, your foreach will fail. You may not have an extension that has wrong flexdata, but this check is there for a reason.
  7. Goran Medakovic commented on patch set 2 10/08/14, 16:00

    I've updated the changes and pushed changed code..

    ContentObjectRenderer.php:1183 Reply

    in this case (using media after adding/deleting dynamic property) : "\n_________________" _ being space
  8. Wouter Wolters commented on patch set 2 10/08/14, 17:24

    Hi Goran, thanks for your work on improving TYPO3 CMS. I see you tried to update your patch, which is great! But you made a small mistake in the process to update a patch in the review system. On http://wiki.typo3.org/CWT are some helpfull texts about how to work with the review system. In this case it is about improving an existing patch. If you use command line you can read http://wiki.typo3.org/Contribution_Walkthrough_with_CommandLine#Improving_the_patch_and_uploading_a_new_Patch_Set Can you try to update your patch accordingly? If you need help feel free to ask:-)
  9. Goran Medakovic uploaded patch set 3 10/08/14, 18:52

  10. Goran Medakovic uploaded patch set 4 10/08/14, 18:57

  11. Markus Klein updated the commit message in patch set 5 10/08/14, 19:45

  12. Markus Klein voted on patch set 5 CR +1 V +1 10/08/14, 19:45

  13. Wouter Wolters voted on patch set 5 V +2 CR +2 10/08/14, 21:38

  14. Wouter Wolters merged patch set 5 10/08/14, 21:38

  15. Wouter Wolters commented on patch set 6 10/08/14, 21:38

    Cherry Picked This patchset was cherry picked to branch TYPO3_6-2 as commit fd38babe92628d176cd89eecd0717a74ce76a1e6