Commit Graph

4686 Commits

Author SHA1 Message Date
Bharat Mediratta
2dc695c606 Merge pull request #129 from shadlaws/fix_1996
#1996 - Add blacklist to legal_file helper.
2013-02-09 10:36:03 -08:00
Bharat Mediratta
7613d886f9 Merge pull request #128 from shadlaws/fix_1994
#1994 - Make get_file_metadata throw an exception if photo or movie is unidentifiable/illegal.
2013-02-09 10:35:04 -08:00
shadlaws
8dcdb3b8e1 #1997 - Update movie dimensions and mime type if previously set without FFmpeg.
- Added code to check/correct movie width, height, and mime in graphics::generate.
As the comment says in the commit, this isn't ideal, but doing it in an upgrade
script wouldn't be very ideal either.
2013-02-09 18:12:08 +01:00
shadlaws
942233dd26 #1996 - Add blacklist to legal_file helper.
Adding a blacklist to legal_file could prevent possible security holes arising
from a contributed module that adds file types by user input (e.g. an admin screen).
2013-02-08 15:21:57 +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
2dc97fab05 #1993 - Remove "failed" query string from upgrader redirect if there are no errors.
- Changed redirect if it finished without failures.
- No change to Upgrader_Controller::index(), since its behavior with an empty vs. undefined failed query is identical.
2013-02-08 09:03:57 +01:00
Bharat Mediratta
59371077c2 Merge branch 'master' of github.com:gallery/gallery3 2013-02-07 15:09:15 -05:00
Bharat Mediratta
27ec3b4c6c Follow-on to 1e4d75c120 for #1975.
Don't try to use an array index on a function return, that's not supported
in PHP 5.3
2013-02-07 15:08:55 -05:00
shadlaws
2da4d9dd1f #1992 - Improve examples for thumb/resize/file path/url functions in item model.
Documentation-only changes to examples used in:
- Item_Model::url
- Item_Model::abs_url
- Item_Model::file_path
- Item_Model::file_url
- Item_Model::resize_path
- Item_Model::resize_url
- Item_Model::thumb_path
- Item_Model::thumb_url
2013-02-07 09:49:28 +01:00
Bharat Mediratta
d9273038b0 Merge pull request #124 from shadlaws/fix_1991
#1991 - Add options to graphics::mark_dirty to specify type and/or mime type
2013-02-06 14:58:25 -08:00
shadlaws
faa719551d #1991 - Add options to graphics::mark_dirty to specify type and/or mime type.
- graphics::mark_dirty - added $type and $mime_type as options.
- graphics::mark_dirty - used options to set additional where conditions.
2013-02-06 11:04:24 +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
428d4f319b Merge branch 'master' of github.com:gallery/gallery3 2013-02-05 13:02:56 -05:00
Bharat Mediratta
c4b2f79a67 Force a sort order no sibling checks. Fixes #1990. 2013-02-05 13:02:26 -05:00
Bharat Mediratta
bc99961305 Merge branch 'master' into jquery_190 2013-02-03 18:56:38 -05:00
Bharat Mediratta
0494244e80 Super first pass:
- jQuery 1.90
- jQuery UI 1.10
- Superfish 1.5.1 (minus all plugins)
- jQuery Form 3.26.0-2013.01.28

Deleted all other jQuery plugins for now.

- Reworked autocomplete to use the latest jQuery code.
- Deleted references to $.browser.msie, no longer supported
- Basic CSS support for autocomplete - lots more work needed there
2013-02-03 18:55:23 -05: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
Bharat Mediratta
3439eb5700 Merge branch 'master' of github.com:gallery/gallery3 2013-02-02 23:41:53 -05:00
Bharat Mediratta
dece6dc5a5 Create gallery::allow_css_and_js_combining() which lets you disable combining CSS/JS
by touching var/DONT_COMBINE.  Fixes #1989.
2013-02-02 23:39:16 -05: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
Mike Miller
6e757f9988 #1987 g2_import module should redirect with a 301, not 302
As the g2_import process is generally assumed to be permanent, the
redirect should be a 301, and not a 302.
2013-02-01 15:36:49 +02:00
Bharat Mediratta
314e2e67b1 Fix ctrl-click behavior. Fixes #1986. 2013-02-01 00:52:14 -05:00
Bharat Mediratta
f72c5a87c8 Follow-on to 9396342250 for #1985 which
was breaking all unit tests.  Use module::install("gallery") instead
of calling gallery_installer::install directly.
2013-01-31 23:45:36 -05:00
Bharat Mediratta
9396342250 Drop the requirement to have the install() function set the module
version.  It's redundant.  Fixes #1985.
2013-01-31 19:55:53 -05:00
Bharat Mediratta
cb08f6cc13 Merge pull request #115 from shadlaws/fix_1982
#1982 - Add placeholder for albums with no album cover.
2013-01-31 15:48:18 -08:00
Bharat Mediratta
ea54a88ec8 Escape the host/username/password arguments to mysqldump. Fixes #1984. 2013-01-31 16:29:09 -05:00
Bharat Mediratta
60c37726ce Merge pull request #116 from shadlaws/fix_1983
#1983: Remove item keys changed for/by graphics::generate from significant changes list.
2013-01-31 11:45:10 -08:00
shadlaws
fd8b8de242 #1983: Remove item keys changed for/by graphics::generate from significant changes list.
There's no need to run through all of the item save/validation logic for these
entries, which are changed frequently during the course of thumb/resize generation.
2013-01-31 18:59:33 +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
8384d7948e Follow-on to 5fca371a61 for #1945.
Previously skipped admin_watermarks mods to use new functionality of #1945
since there was concurrent work on it with #1970.
Now that both are done, we can wrap this up.
2013-01-31 12:40:55 +01:00
Bharat Mediratta
8d15e5cb2e Follow-in to cff1e76e8d for #1978
Restrict which album cover ids we swap over to the hierarchy of the
current album, otherwise we can wind up in sticky situations with
hierarchical album cover chains.

Eg, you have a hierarchy like this:

root -> A1 -> A2 --> A3 -> P1
                     A4 -> P2

P1 is the album cover for its entire hierarchy.  But then you
swap A2's album cover for A3 making this:

root -> A1 -> A2 +   A3 -> P1
                 \-> A4 -> P2

Since A1, A2 and A3 all had P1 as their album cover item id.  Now
we're swapping it over to P2 but we want to leave P1 as A3's album
cover item id.  So only look at A4's hierarchy and ignore its peers.
2013-01-30 21:42:47 -05:00
Bharat Mediratta
71cf911649 Support additional where tuples in ORM_MPTT::parents. Fixes #1980. 2013-01-30 21:38:32 -05:00
Bharat Mediratta
075b95f0ed Actually disable the "make album cover" option when the item is already the album cover. Fixes #1979. 2013-01-30 21:18:26 -05:00
Bharat Mediratta
cff1e76e8d When changing the album cover, find and retarget any other albums which were using the old item as their album cover. Fixes #1978. 2013-01-30 21:08:36 -05:00
Bharat Mediratta
d8d01e0aa0 Merge pull request #112 from shadlaws/fix_1968
#1968 - Improve album cover generation/removal/etc.
2013-01-30 17:17:06 -08:00
Bharat Mediratta
49dd0994df Follow-on to 1e4d75c120 for #1975.
Create a siblings() function which pulls together the siblings_callback
function and makes it a more palatable API.
2013-01-30 19:32:35 -05:00
Bharat Mediratta
9ef891858c Protect admins from themselves - in case an admin changed the
watermark.name setting to something terrible by accident via Admin >
Advanced, we'll just use the basename.  Fixes #1977.
2013-01-30 18:45:49 -05:00
Bharat Mediratta
92c264033a Don't concatenate tainted strings in JS. Fixes #1976. 2013-01-30 14:19:44 -05:00
Bharat Mediratta
1e4d75c120 Improve the display context API to return a "siblings_callback" field
containing a callback that returns all the siblings.  Fixes #1975.
2013-01-30 12:10:18 -05:00
Bharat Mediratta
6e609c249a Merge pull request #110 from mikeage/g2_import
#1973 Handle redirected G2 URLs for tags, including g2_itemId passed
2013-01-30 07:53:56 -08:00
Mike Miller
91acf812a1 #1973 Handle redirected G2 URLs for tags, including g2_itemId passed 2013-01-30 05:59:08 +02: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
Bharat Mediratta
ed7e2d5089 Merge pull request #108 from shadlaws/fix_1970
#1970 - Make add watermarks more secure and add unit tests.
2013-01-29 10:29:25 -08:00
shadlaws
4cf31d8850 #1970 - Make add watermarks more secure and add unit tests.
This follows #1855 and #1951...
- Ensured that invalid or illegal files are not added even if they have valid extensions.
- Added unit tests (currently there aren't any...)
2013-01-29 18:48:39 +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
Bharat Mediratta
2551b31b8f Merge pull request #106 from shadlaws/fix_1945
#1945 - Extend legal_file helper functions.
2013-01-29 09:10:06 -08:00
Bharat Mediratta
3b0de7791b Merge pull request #107 from shadlaws/fix_1969
#1969 - Give graphics events the ability to override the standard process
2013-01-29 09:01:31 -08: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
shadlaws
1313a02bf4 #1971 - Make resequence_child_weights_test unit test more reliable.
- Set the sort_column of the parent album to id, which has no possibility of being identical between the two photos.
- Now, the reweighting will reverse the order even if they were created during the same second.
2013-01-28 14:47:26 +01:00