Issue Bug Closed

#99184ValueException in GeneralUtility intExplode/trimExplode

Stefan Froemken 11/24/22, 15:28 updated 01/12/23, 12:33

Description

Hi,

If you call GeneralUtility::intExplode() or GeneralUtility::trimExplode() with an empty string as delimiter a ValueException will be thrown since PHP 8.0.

Maybe such calls should be wrapped in a try-catch block?

Stefan

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 4

  1. Stefan Froemken changed Related to #99178 11/24/22, 15:28

  2. Stefan Froemken commented 11/24/22, 15:29

  3. Georg Ringer commented and changed status New Needs Feedback 01/12/23, 11:31

    Thanks for creating this issue. TBH I would close this issue and don’t change anything – this will help the developers to find the issue and solve it. what should happen in the catch block?

  4. Stefan Froemken commented and changed status Needs Feedback Closed 01/12/23, 12:33

    Hi Georg,

    sorry. Don’t remember anymore in which case I need that.

    In glossary2 I had a ABCDE-list and want to convert them into an [A, B, C, D, E] array. Currently I have solved it with str_split

    In jwtools2 I want to split content somehow. Currently solved with preg_match.

    So, no need to investigate more time here, as I have found alternative solutions

    Stefan