Review main Merged

24018[BUGFIX] Check for string before using strlen

Kilian Hann CR +2 V +2 Normal +66 −6 updated 09/26/13, 21:36

Commit message

If pi_flexform is converted to an array already, checking via strlen
produces a warning. An additional check via is_string suppresses the
warning.

Review

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

Issues 2

Files 2

Review log 23

  1. Mr. Jenkins commented on patch set 1 09/24/13, 13:51

  2. Stefan Froemken commented on patch set 1 V +1 CR +1 09/24/13, 16:04

    It works, but maybe it would be good to modify UnitTests, also?
  3. Wouter Wolters updated the commit message in patch set 1 09/24/13, 16:45

  4. Mr. Jenkins commented on patch set 2 09/24/13, 16:56

  5. Stefan Froemken commented on patch set 2 V +1 CR +1 09/24/13, 16:59

    As told before. I'm missing an UnitTest for a given string.
  6. Markus Klein commented on patch set 2 09/24/13, 18:17

    What about 4.7?
  7. Markus Klein uploaded patch set 3 09/24/13, 18:28

  8. Markus Klein voted on patch set 3 V +1 CR +1 09/24/13, 18:28

  9. Mr. Jenkins commented on patch set 3 09/24/13, 18:38

  10. Stefan Froemken commented on patch set 3 V -1 CR -1 09/26/13, 06:57

    see comment

    FrontendConfigurationManager.php:168

    What about these three methods "mergeConfigurationIntoFrameworkConfiguration"? They will never be executed if $flexFormData is already an array.
  11. Markus Klein commented on patch set 3 09/26/13, 09:42

    FrontendConfigurationManager.php:168 Reply

    They were not executed before the patch either. So this not an issue here.
  12. Helmut Hummel commented on patch set 3 09/26/13, 10:27

    FrontendConfigurationManager.php:168 Reply

    http://php.net/strlen "5.3 Prior versions treated arrays as the string Array, thus returning a string length of 5 and emitting an E_NOTICE level error" So the behavior is very different in PHP 5.2 in this case and the patch will make this in PHP 5.2 behave like in 5.3 and higher. The question is: What is the expected behaviour?
  13. Helmut Hummel commented on patch set 3 CR -1 09/26/13, 10:33

    Reading Ollys comment from #51684 I'd say this patch is wrong. It should instead transform it to an array and perform the merge if the array is not empty
  14. Stefan Froemken commented on patch set 3 09/26/13, 10:44

    see comment

    FrontendConfigurationManager.php:168 Reply

    The expected behaviour is that the three merge lines have to be executed regardless to any conditions before. If it is a string, extbase has to convert the value to an array else nothing is to do. Further it must be checked if there are any entries in array. If so, the merge methods have to be executed. The most interesting question is: Should we create an additional patch for this problem or should we give Markus an additional task to solves this problem directly here with a new patch?
  15. Markus Klein commented on patch set 3 V 0 CR 0 09/26/13, 11:02

    FrontendConfigurationManager.php:168 Reply

    @Stefan: "give Markus an additional task".... Everything ok with you???
  16. Stefan Froemken uploaded patch set 4 09/26/13, 12:11

  17. Mr. Jenkins commented on patch set 4 09/26/13, 12:21

  18. Markus Klein commented on patch set 4 09/26/13, 12:41

    I suggest using a data provider for the tests. So we can at least combine the last 3.
  19. Christian Kuhn commented on patch set 4 V +1 CR +1 09/26/13, 20:54

    +1. The tests currently still read fine without a data provider, imho that is not a must-have to get the patch in. On backporting, I would probably skip the tests below 6.0. Anyone else up for a vote?
  20. Wouter Wolters voted on patch set 4 V +2 CR +2 09/26/13, 21:33

  21. Markus Klein voted on patch set 4 V +2 CR +2 09/26/13, 21:34

  22. Markus Klein merged patch set 5 09/26/13, 21:34

  23. Markus Klein commented on patch set 5 09/26/13, 21:36

    Cherry Picked This patchset was cherry picked to change: I97c41cdedb1afb28e2a9ca39e1d9cfb3921d9f47