Review main Merged

5479[BUGFIX] meaningfulTempFilePrefix is not multi-byte safe

Jigal van Hemert CR +2 V +2 Easy +22 −6 updated 06/03/13, 20:49

Commit message

On a utf-8 file system meaningful prefixes can contain utf-8 characters. To
prevent truncating in the middle of a multi-byte character the API functions
must be used instead of substr().

Review

  • Code review CR +2
    • Jigal van Hemert +2
    • Helmut Hummel +1
  • Verified V +2
    • Jigal van Hemert +2
    • Helmut Hummel +1

Issues 1

Files 2

Review log 17

  1. Helmut Hummel commented on patch set 1 10/04/11, 20:49

    Verified; Looks good to me, but someone else must approve one minor comment, everything else looks good

    class.tslib_gifbuilder.php:736

    Could be just: $meaningfulPrefix .= '_';
  2. Helmut Hummel commented on patch set 1 10/04/11, 20:49

    Fails sorry, have to revert my +1 by testing as the original problem seems not to be fixed... I first tested IMAGE only not IMG_RESOURCE
  3. Helmut Hummel uploaded patch set 2 10/04/11, 20:49

  4. Helmut Hummel commented on patch set 2 10/04/11, 20:49

    Verified; Looks good to me, but someone else must approve Got it. the special handling in getImgResource() is not needed, as all special characters are thrown away in line 4967 anyway: $filename = preg_replace('/[^A-Za-z0-9_-]/', '', trim($filename));
  5. Helmut Hummel commented on patch set 2 10/04/11, 20:49

    Hm, when thinking about it again: Why not also throw a way all special characters in the gifbuilder class? Much less effort that handling it correctly (and probably still breaking some weird browsers)...
  6. Helmut Hummel uploaded patch set 3 10/04/11, 20:49

  7. Helmut Hummel uploaded patch set 4 10/04/11, 20:49

  8. Helmut Hummel commented on patch set 5 10/04/11, 20:49

    Verified; Looks good to me, but someone else must approve OK, Jigal raised a good point, that if utf-8 filesystem is used meaningful prefix for images should also include the characters of the file and not only ascii...
  9. Helmut Hummel uploaded patch set 5 10/04/11, 20:49

  10. Steffen Gebert commented on patch set 2 10/04/11, 20:49

    Thanks for your investigations, Helmut! I started fixing this at the wrong place, thus only 50% have been tested and that's why I didn't push it to Gerrit myself. Nevertheless, thanks Jigal for taking care.
  11. Mr. Jenkins commented on patch set 1 10/04/11, 20:49

  12. Mr. Jenkins commented on patch set 2 10/04/11, 20:49

  13. Mr. Jenkins commented on patch set 3 10/04/11, 20:49

  14. Mr. Jenkins commented on patch set 4 10/04/11, 20:49

  15. Mr. Jenkins commented on patch set 5 10/04/11, 20:49

  16. Jigal van Hemert commented on patch set 5 V 0 10/04/11, 20:49

    by team member; Looks good to me, approved
  17. Jigal van Hemert merged patch set 5 10/04/11, 20:49