Review main Merged

48425[BUGFIX] Detect the conversion to string "0" in stdWrap_csConv

Elmar Hinz CR +2 V +2 Easy +7 −6 updated 02/26/17, 21:03

Commit message

Check for the return value of the converter to be of type string or
return the input. The string "0" is detected.

If the return string of the converter is the empty string, return the
input. This is done to keep the previous behaviour apart from the "0"
issue.

Update the method comment.

Review

  • Code review CR +2
    • Anja Leichsenring +2
    • Christian Kuhn +1
  • Verified V +2
    • Anja Leichsenring +2
    • Christian Kuhn +1
    • TYPO3com +1 CI

Issues 1

Files 1

Review log 2024

  1. Elmar Hinz uploaded patch set 1 06/01/16, 06:44

  2. Elmar Hinz uploaded patch set 2 06/01/16, 06:47

  3. Elmar Hinz uploaded patch set 3 06/01/16, 07:05

  4. Elmar Hinz updated the commit message in patch set 4 06/01/16, 07:07

  5. Wouter Wolters commented on patch set 4 CR -1 06/04/16, 11:27

    This change should have a unit test to prove that it fails before and is fixed with this change
  6. Elmar Hinz commented on patch set 4 06/04/16, 17:57

    The difficulty to write a test to prove it fails, is in finding a character set that encodes the string "0" differently.
  7. Elmar Hinz commented on patch set 4 06/10/16, 06:49

    Due to not knowing an appropriate dataset for the test, I can only provide a test to show that '0' evaluates to false within a condition. /** * @test */ public function StringZeroEvalsToFalse() { if('0') $bool = true; else $bool = false; $this->assertFalse($bool); } https://github.com/elmar-hinz/Playground.PHP/blob/master/Tests/Behaviour/ShadesOfEmpty.php
  8. Elmar Hinz commented on patch set 4 06/10/16, 08:42

    s/dataset/character set/
  9. Elmar Hinz commented on patch set 4 06/10/16, 21:05

    I think I found a character set that would trigger the bug: GEORGIAN-PS. * http://perl.mines-albi.fr/perl5.8.5/site_perl/5.8.5/Locale/RecodeData/GEORGIAN_PS.html * https://www.gnu.org/software/libiconv/ While ascii based character sets encode "0" as 48 it encodes it by 30. 1.) Input 30 ("0" encoded by GEORGIAN-PS) is converted to 48 (utf-8 "0") 2.) 48 fails in in the ternary operator and the original input is returned, 30, but assumed to be uft-8 now, wich is the cancel sign. Wouter requests: "This change should have a unit test to prove that it fails before and is fixed with this change". I have no idea how a unit test can apply the change.
  10. Markus Klein commented on patch set 4 06/11/16, 13:12

    ContentObjectRenderer.php:2540

    is the same as a simple: $output !== ''
  11. TYPO3com voted on patch set 4 V +1 12/04/16, 10:57 Completed build in 15m 51s on Sun, 4 Dec, 11:57 AM Test Summary: 54322 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5463

  12. Georg Ringer uploaded patch set 5 02/09/17, 03:37

  13. TYPO3com voted on patch set 5 V +1 02/09/17, 03:43 Completed build in 05m 25s on Thu, 9 Feb, 04:43 AM Test Summary: 56225 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7820

  14. Markus Klein commented on patch set 5 02/09/17, 08:23

    ContentObjectRenderer.php:2422

    where? this should be mentioned
  15. Elmar Hinz commented on patch set 5 02/10/17, 08:17

    ContentObjectRenderer.php:2540 Reply

    What if conv() would return FALSE as an error of one of it's sub-functions?
  16. Markus Klein commented on patch set 6 02/10/17, 10:09

    Published edit on patch set 5.
  17. Markus Klein commented on patch set 6 02/10/17, 10:09

    ContentObjectRenderer.php:2422

    last comment still applies here
  18. TYPO3com voted on patch set 6 V +1 02/10/17, 10:14 Completed build in 04m 44s on Fri, 10 Feb, 11:13 AM Test Summary: 56207 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-7895

  19. Mona Muzaffar uploaded patch set 7 02/24/17, 13:55

  20. TYPO3com voted on patch set 7 V +1 02/24/17, 14:05 Completed build in 09m 13s on Fri, 24 Feb, 03:05 PM Test Summary: 57501 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-8492

  21. Mona Muzaffar commented on patch set 6 02/24/17, 14:05

    rebased
  22. Christian Kuhn voted on patch set 7 CR +1 V +1 02/26/17, 20:54

  23. Anja Leichsenring voted on patch set 7 CR +2 V +2 02/26/17, 21:03

  24. Gerrit merged patch set 7 02/26/17, 21:03