Vinai / nicer-image-names

Magento extension to build catalog image file names from product attributes so they have neat descriptive names.
77 stars 31 forks source link

Couple of length checking fixes #15

Closed mikemanger closed 10 years ago

mikemanger commented 10 years ago

875566d fixes _getFileNameParts expecting just the file and extension (/oldname/new-file-name.extension) and not the full path. bbbcd7e checks filename length which should be 255 characters for most file systems (shame there isn't a PHP_MAXFILELENGTH)

I have tested this on Linux and Windows. Feel free to refactor as I can see the setBaseFile function getting a bit messy. Would be willing to help out with some unit tests.

Vinai commented 10 years ago

Any tests are very welcome.
This module is legacy code to be honest, so it contains no tests at all so far.
Plain PHPUnit is best, having the tests use EcomDev_PHPUnit is fine, too.