466 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
Brad Dutton
6cca47732f fix xss file 2022-01-08 17:15:13 -08:00
Brad Dutton
2ab6eae18a fix tests 2022-01-08 17:07:41 -08:00
Brad Dutton
954f468e50 ignore vendor files in tab test 2021-10-24 23:45:50 -07:00
Brad Dutton
96e7f17a67 changes to get tests passing with PHP 8 2021-04-23 14:33:53 -07:00
Brad Dutton
6b9235f9a7 skip vendor dir in checks 2021-04-23 12:06:43 -07:00
Brad Dutton
86d59b25b2 fix tests 2021-04-01 19:03:46 -07:00
Brad Dutton
fb32154d5d fix CI 2021-02-17 17:32:39 -08:00
Brad Dutton
faa69d24b9 use the standard video tag to render videos 2021-02-17 16:04:35 -08:00
Bradley W Dutton
3f3e64511b load gallery module before the rest of the modules, fix corresponding test 2020-11-30 19:02:44 -08:00
bwdutton
cf63f47e20 skip the vendor directory in tests 2020-05-29 15:59:41 -07:00
Bradley W. Dutton
b8b6ac9d6b fix php 7.3 errors 2020-02-01 20:21:58 -08:00
bwdutton
6835d8c202 set locale to en_US so time/number compares don't fail later on 2020-02-01 16:43:31 -08:00
bwdutton
6a686d3b03 switch travis to php 7.0
don't fail on deprecated function warnings
remove debug
2020-02-01 15:14:07 -08:00
bwdutton
761de1b42f get the CI tests fully working again 2020-02-01 14:17:33 -08:00
Bharat Mediratta
35bd97fe19 Follow-on to 9e0631ab0d to fix broken tests. 2014-05-28 15:33:57 -04:00
shadlaws
fe40dadd5c Fix Controller_Auth_Test - T_CURLY_OPEN not parsed as "{". Update golden file.
--HG--
extra : source : 816294dd5f6fe23160baf9f516e49c66ea8fcb6c
2013-06-26 23:49:48 +02:00
Bharat Mediratta
c70646237e Rename uploadify SWF wrappers to end in .swf.php for consistency. 2013-06-08 16:34:16 -04:00
Bharat Mediratta
b6ad4157d1 Get rid of the security preamble - we intend for these files to be directly accessible. 2013-05-09 20:09:15 -04:00
Bharat Mediratta
e4a3abdd20 Change upload code to use new uploadify urls. 2013-05-09 20:04:01 -04:00
Bharat Mediratta
9b1c6ab14f Golden file update follow-on for c37288f0b2 2013-04-14 00:28:29 -04:00
Bharat Mediratta
a5700a2f3c Merge pull request #202 from shadlaws/fix_2051
#2051 - Revise how Gallery_View returns combined JS and CSS.
2013-03-13 21:10:25 -07: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
a1b5cf2e8d #2051 - Revise how Gallery_View returns combined JS and CSS.
Changed Gallery_View's JS and CSS combining to:
- have get_combined() combine all groups if called without arguments.
- ensure the "core" group is combined first.
- always put links where get_combined() is called, even if combining is disabled (otherwise the order isn't preserved).
- add key as cache buster when combining is disabled.
- make "LOOKING FOR YOUR CSS/JAVASCRIPT..." comments in get_combined(), not in the theme itself.
Also, revised xss_data.txt golden file (line number changes only).
2013-03-12 15:00:59 +01:00
shadlaws
ed20798b99 #2057 - Revise item name and slug validation - backslashes, refactor, error messages.
- disallowed backslashes in item validation.
- refactored the validation logic in the item model a bit.
- added no_backslash error messages in edit album/photo/movie forms.
- fixed error messages in add album forum (some missing, some text different from edit)
- added unit tests
- updated to v58 to correct any existing backslashes in item names
2013-03-12 12:14:34 +01:00
shadlaws
b43349f4de #2048 - Remove unneeded jquery.autocomplete.css/js inclusions.
- removed autocomplete.css/js calls in server_add, tag, and g2_import.
- revised xss_data.txt golden file (line number changes only).
2013-03-10 22:08:16 +01:00
shadlaws
18f38f0dff #2046 - Change Gallery over to using MediaElementJS as its movie player. 2013-03-09 12:51:45 +01:00
Bharat Mediratta
dc7bf9486f Follow-on for #2043. Fix some tests that made bad assumptions about
the state of the world.  These were uncovered when we ran the tests on
Travis which runs the tests in a different order than what I (and
apparently others) use on their dev boxes.
2013-03-06 14:33:24 -05:00
Bharat Mediratta
d2577c066b Follow-on to 384bc7afc8 for #2033
Update golden file for XSS test.
2013-03-05 21:27:44 -05:00
Bharat Mediratta
e772767363 Merge pull request #179 from shadlaws/fix_2034
#2034 - Add webm and ogv as valid movie types.
2013-03-03 14:23:48 -08:00
shadlaws
9d7d6c50bb Follow-on to #2033 - Rename movieplayer.html.php to movieplayer-flash.html.php
- renamed file with "-flash" to make room for html5 player
- updated item model and xss_data.txt to reflect changes

--HG--
rename : modules/gallery/views/movieplayer.html.php => modules/gallery/views/movieplayer-flash.html.php
2013-03-03 00:45:03 +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
9b9f1a7b07 #2031 - Add class_exists() before method_exists() if class existence is unknown.
- fixed all instances of this in core code
- deleted previous Zend Guard Loader workaround in MY_Kohana.php
- updated Bootstrap.php to reflect deleted MY_Kohana.php
2013-03-02 13:25:10 +01:00
shadlaws
251e9d5c8f #2010 - Revise item::find_by_path to search for jpg-converted items.
- added extra $var_subdir argument to item::find_by_path.
- changed item::find_by_path to use $var_subdir to detect if we should look for a jpg-converted item or not (e.g. movie thumbs)
- moved the album thumb detection to item::find_by_path to ensure it knows to look for an exact album match.
- added more sanity checks to item::find_by_path (now has fewer false positive possibilities).

- updated file_proxy to remove the need to guess different movie files.
- updated File_Proxy_Controller - new sanity checks catch previously undetected bug.
- added additional unit tests for item::find_by_path.
2013-02-26 18:39:59 +01:00
shadlaws
f980608987 Follow-on from autocomplete and gallery.panel.js revisions.
(9345dde83e, d632ef3e50, fd012276cb)
- revised xss_data.txt golden file (no new cases).
- escaped translated string in admin_users.html.php (would have otherwise been a new case in xss_data.txt).
2013-02-25 15:09:42 +01:00
shadlaws
94aadf03da #2008 - Add warnings if some active modules are obsolete.
- added module::get_obsolete_modules_message function
- put message on admin/dashboard
- put message on admin/modules
- put message on upgrader
- updated unit test golden file xss_data
2013-02-20 17:30:27 +01:00
Bharat Mediratta
3e3ed1c819 Fix up some tests:
- unlink copied files because they confused File_Structure_Test
- update golden files
2013-02-18 15:31:59 -05:00
shadlaws
f212f6a794 #2003 - Add admin/movies screen.
Added admin/movies screen analogous to the admin/graphics screen so the user can:
- see how FFmpeg is configured (path and version, similar to toolkits in admin/graphics)
- get some instructions on how to install FFmpeg if not found
- change the movie_allow_uploads setting
- ask Gallery to rebuild their movie thumbs
Specifics:
- admin_movies, admin_movies.html (new) - new Movies admin screen
- ffmpeg.png (new) - logo for admin screen
- movie::get_ffmpeg_version (new) - return version number and date of FFmpeg
- form_uploadify.html - change admin message if movie uploads are disabled
- gallery_event::admin_menu - added Movies link to Settings
- xss_data.txt - updated golden file for unit tests
2013-02-14 23:42:20 +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
0312d1b071 #1994 - Make get_file_metadata throw an exception if photo or movie is unidentifiable/illegal.
- photo & movie helpers: modified to throw exceptions when file is known to be unidentifiable/illegal.
- item model: revised to work with exceptions and be more explicit when the data file is invalid.
- item model: removed duplicate get_file_metadata call for updated items.
- admin_watermarks controller: revised to work with exceptions (really cleans up logic here).
- graphics helper: revised to handle invalid placeholders (a nearly-impossible corner case, but still...).
- photo & movie helper tests: revised to work with exceptions, added new tests for illegal files with valid extensions.
- item model tests: revised to work with exceptions, added new tests for illegal files with valid extensions.
2013-02-08 13:51:41 +01:00
shadlaws
1ae1165229 Follow-on to 949b8cda14 for #1982.
- Add extra condition to Item_Model_Test::urls_test to test cache busters of missing files.
- Previous commit fixes unit test for empty album url, but now no test checks missing files.
2013-02-06 10:24:06 +01:00
Bharat Mediratta
0d9c4da0ff Merge pull request #118 from shadlaws/fix_1982_followon
Follow-on to f83ed5f871 for #1982.
2013-02-03 09:44:51 -08:00
shadlaws
bc0bf10643 Follow-in to 314e2e67b1 for #1986.
- Update xss_test golden file (change line numbers).
2013-02-02 14:04:15 +01:00
shadlaws
949b8cda14 Follow-on to f83ed5f871 for #1982.
- Fix unit test for album url since empty albums now have thumbnails.
2013-02-02 10:02:37 +01:00
shadlaws
f83ed5f871 #1982 - Add placeholder for albums with no album cover.
- Added missing_album_cover.jpg placeholder image.
- Modified the graphics helper to use it.  Calling graphics::generate will copy it.
- Modified item::remove_album_cover and gallery_event::item_created to run graphics::generate.
- Added unit test to Graphics_Helper_Test.
2013-01-31 17:18:39 +01:00
shadlaws
cf07742595 #1968 - Improve album cover generation/removal/etc.
- Added stanza to Item_Model::save that handles when cover id is null.
- Added logic to graphics::generate to copy/convert album cover thumbs from their item thumbs to ensure they're always jpg, and eliminate the possibility that we copy/convert a dirty thumb.
- Redirected other places in code where we want to do one of the above two things to use these two functions instead (gallery_event::item_updated_data_file, item::make_album_cover, item::remove_album_cover).
- Improved validation in Item_Model so only albums can have covers and all covers must be non-albums.
- Added unit tests to Graphics_Helper_Test.
2013-01-30 01:07:36 +01:00
shadlaws
536bdaa4db #1967 - Improve how graphics::generate handles missing/bad images.
- Made missing_photo match the image format (jpg, png, etc.).
- Swapped missing_photo.png for missing_photo.jpg since it's likely to require less conversion to match.
- Improved error messages to user when things go wrong.
- Ensured that missing image placeholders are always copied when there's an error.
- Ensured we don't mistake no file output for a correct file output (delete target before attempt).
- Restructured graphics::generate a bit to work better with above changes.
- Added unit tests for graphics::generate.
2013-01-29 18:35:10 +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