14 Commits

Author SHA1 Message Date
Brad Dutton
67d40a50ec update tests for new webp file types 2022-06-04 11:56:10 -07:00
Brad Dutton
3ee59350a1 php 8.1 updates 2022-01-08 20:33:23 -08:00
shadlaws
8d0e1b4c4d #2059 - Add album name sanitizing similar to photo/movie filename sanitizing.
- added legal_file::sanitize_dirname(), analogous to sanitize_filename.
- revised item model to use new function when adding or updating an album.
- added some legal_file unit tests.
- revised some item model unit tests.
2013-03-13 10:07:58 +01:00
shadlaws
e7b224461a #2034 - Add webm and ogv as valid movie types.
- added them to legal_file helper
- revised unit tests
2013-03-03 00:16:38 +01:00
shadlaws
d04a6fc87d #2001 - Make filename sanitizing more consistent.
- legal_file - added sanitize_filname() to sanitize photo/movie filenames.
- admin_watermarks - revised add() to use new function.
- item model - added _process_data_file_info() to validate the data file, get its metadata, and sanitize the item name.
- item model - revised save() for new items to use _process_data_file_info *before* the slug is checked.
- item model - revised save() for updated items to use _process_data_file_info.
- item model - revised save() for updated items to sanitize name if changed.
- uploader - removed call to smash_extensions (item model does this when it calls sanitize_filename).
- Legal_File_Helper_Test - added unit tests for sanitize_filename.
- Item_Model_Test - revised existing unit tests based on changes.
- Item_Model_Test - added new unit tests for names with legal but incorrect extensions.
- Averted take over by HAL with fix #2001...
2013-02-12 00:37:33 +01:00
shadlaws
bfdf5a00fd #2000 - Make legal_file::smash_extensions more robust.
- Fixed legal_file::smash_extensions.
- Added new unit test.
- Removed duplicated condition in existing unit test.
2013-02-10 02:28:47 +01:00
shadlaws
5fca371a61 #1945 - Extend legal_file helper functions.
- Added get_types_by_extension function, which is a merged version of get...types_by_extension functions (similar to get_extensions).
- Added optional extension argument to get...extensions functions similar to get...types_by_extension functions.
- Added unit tests.  Now, every legal_file function has one.
- Restructured helper file to include caches.
- Added array_unique to get...types (derived from get...types_by_extension, which can be many-to-one).
- Edited server_add, uploader, and item model to use new functionality.
2013-01-28 23:31:18 +01:00
Bharat Mediratta
d45a737779 Update copyright to 2013. Fixes #1953. 2013-01-21 01:22:01 -05:00
Bharat Mediratta
a06abe32b0 Simplify get_photo_types_by_extension_test and get_movie_types_by_extension_test. 2013-01-20 00:39:58 -05:00
shadlaws
e2a2a5ce81 #1944 - Fix possible warnings in legal_file::get_photo_types_by_extension and legal_file::get_movie_types_by_extension.
Added unit tests for these two functions, too.
2013-01-19 00:52:13 +01:00
shadlaws
3a9009492e #1943 - Make legal_file::change_extension more robust.
Previously would fail with dots in the directory but no extension.  Added unit tests to verify the new change works.
2013-01-18 20:06:05 +01:00
Bharat Mediratta
9e2ea2ffed Smash multiple extensions down into a single one when accepting file
uploads.  Fixes #1872.
2012-05-17 20:25:27 -07:00
Bharat Mediratta
ffbaa7bf82 Follow on for #1845 - handle paths with dots in them properly. 2012-05-13 21:09:59 -07:00
Bharat Mediratta
ef4dbd18af Fix extension-swapping code for files that have extensions that are
not 3 characters long.  Fixes #1845.
2012-05-05 19:34:01 -07:00