191 Commits

Author SHA1 Message Date
Brad Dutton
3ee59350a1 php 8.1 updates 2022-01-08 20:33:23 -08:00
Bradley W. Dutton
680de0c6d0 fix implode() so the separater is always the first argument 2020-02-01 20:53:43 -08:00
shadlaws
d0aef95a65 Move "item_moved" event later in the item update process. Fixes #2077.
Before, this was before the children's caches were cleared, so if the
"item_moved" set an album cover, it would fail with an invalid path.  For the
same reason, we move it after the data file update, too.  Lastly, get we get
rid of duplicated code in item::move() since the "item_moved" event already
does this.
2013-07-08 09:39:54 +02: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
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
18f38f0dff #2046 - Change Gallery over to using MediaElementJS as its movie player. 2013-03-09 12:51:45 +01:00
Bharat Mediratta
24475e914f Merge pull request #187 from shadlaws/2033_followon
Follow-on to #2033 - Change variables and js script loading for Flash Fl...
2013-03-04 15:34:11 -08:00
Bharat Mediratta
f1884b59f1 Merge pull request #183 from shadlaws/fix_2037
#2037 - Fix bug with "item_before_update" event in item model.
2013-03-04 15:14:04 -08:00
shadlaws
a517d9a33a Follow-on to #2033 - Change variables and js script loading for Flash Flowplayer.
- changed movie_img event variable names to have "flash" in them.
- moved flowplayer.js loading from page.html.php to movieplayer-flash.
- removed conditional loading for small, photo-specific JS files in page.html.php
to keep combined JS consistent between page types (better for caching).
2013-03-04 23:44:50 +01:00
shadlaws
295fadd570 #2037 - Fix bug with "item_before_update" event in item model. 2013-03-03 23:42:02 +01: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
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
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
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
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
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
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
cc2aed656c #1946, 1947 - Make altered names/slugs more user-friendly, make conflict-finding code check filenames with no extensions
- Reduced from four places that alter names/slugs to two (one to populate empty slugs, one to handle conflicting names/slugs).
- For empty slugs, fill with generic human-readable name (e.g. "photo") instead of random value.
- For conflicting names/slugs, add suffix that's sequential (e.g. "-01"), only using random after 99 conflicts.
- Made conflict-finding code check filenames with no extensions.
- Renamed _randomize_name_or_slug_on_conflict to _check_and_fix_conflicts.
- Added unit tests.  Also cleaned up existing unit tests to reflect new logic and removed a redundant test.
- Added installer logic to correct existing items now considered in conflict.
- Revised gallery_task to look for duplicate names based on new criteria.
2013-01-26 08:38:31 +01:00
Bharat Mediratta
9ba9f39531 Add a "can_add" permission bit similar to the "can_edit" bit to the RESTful array
representation of Item_Model.  Fixes #1903.
2013-01-23 18:24:31 -05:00
Bharat Mediratta
d45a737779 Update copyright to 2013. Fixes #1953. 2013-01-21 01:22:01 -05:00
shadlaws
8300c867a1 #1931, #1932, #1933, #1934 - movieplayer view and movie_img function in items model
Many changes to movieplayer view and movie_img function in items model:
- include control bar height when dimensioning movie player
- provide a default "guess" at height and width when they are set as zero in items table
- resize movie player once the video is loaded based on its actual metadata
- add get_movie_img event to provide flexibility for altering/replacing the default Flowplayer v3

--HG--
extra : rebase_source : 5d1e9bb66ebf3e3fed5e1b9ee63790a204f21450
2012-12-30 10:03:36 +01:00
Bharat Mediratta
6d9d6a2e5d Allow albums to have two (or more) dots in the name. Fixes #1897. 2012-07-21 15:01:31 -07: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
aac18ef833 Don't allow new albums with a slug that matches a controller - put up a
message telling the user that it's a reserved address.  Partial fix for #95.
2012-05-15 15:53:38 -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
Bharat Mediratta
801c9a98e4 Fix #1846. 2012-05-05 18:52:44 -07:00
Bharat Mediratta
bf2bb3e1ea Update copyright to 2012. #1822 2012-02-27 09:48:23 -08:00
Chad Parry
0672c8f83f Polishing the rawphoto changes, including adding some tests.
Squashed commit of the following:

commit 945316a8c220b12adb687c896bcc5e86f99f46a4
Author: Chad Parry <github@chad.parry.org>
Date:   Thu Jul 21 01:11:13 2011 -0600

    Add a test for the sunny-day scenario where a rule changes a data file's MIME type.

commit 4ee1ee000c8f4d8ebaae66f637bc71080486fd73
Author: Chad Parry <github@chad.parry.org>
Date:   Thu Jul 21 00:49:47 2011 -0600

    Ensure that a third-party cannot swap out a legitimate photo with an unsafe file type.

commit 7dd0105bfc59c150e5640e693778f51bbaa44eab
Author: Chad Parry <github@chad.parry.org>
Date:   Thu Jul 21 00:48:19 2011 -0600

    Update the MIME type and other meta-data when a new data file is provided.

commit 5a8844c7947b21cf658f22cc61f20ffa9e8f07f2
Author: Chad Parry <github@chad.parry.org>
Date:   Thu Jul 21 00:30:01 2011 -0600

    Remove a unit test that no longer applies. Replacement data files are allowed to have different MIME types.

commit 0de9c6283ce4f5773cad8e92b6785d6a1f7b5e46
Author: Chad Parry <github@chad.parry.org>
Date:   Thu Jul 21 00:27:45 2011 -0600

    If one rule fails, then abort processing, rather than trying to proceed to subsequent rules.

commit 41d379c2b777ae7b3a11f528971228e234f8976f
Author: Chad Parry <github@chad.parry.org>
Date:   Thu Jul 21 00:10:10 2011 -0600

    Replace an overly-complicated regular expression with a simple in_array, at Bharat's suggestion.

commit 1b3f7111d4c2607baaa2da0aab3b501f2d9a1426
Merge: 8f7904a 403f64b
Author: Chad Parry <github@chad.parry.org>
Date:   Wed Jul 20 21:02:56 2011 -0600

    Merge branch 'master' into rawphoto

commit 8f7904ab62c71a7e4ee68762f936030b4dcb4ea1
Merge: e950573 771de0a
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Jun 25 14:12:39 2011 -0600

    Merge branches 'master' and 'rawphoto' into rawphoto

commit e95057337996351e49915d9f85d007d50103a4be
Author: Chad Parry <github@chad.parry.org>
Date:   Wed Jun 15 20:24:18 2011 -0600

    Merge branches 'rawphoto-squash' and 'rawphoto' into rawphoto
2011-07-21 01:12:26 -06:00
Chad Parry
44b624f6fb Squashed commit of the following:
commit 41d379c2b777ae7b3a11f528971228e234f8976f
Author: Chad Parry <github@chad.parry.org>
Date:   Thu Jul 21 00:10:10 2011 -0600

    Replace an overly-complicated regular expression with a simple in_array, at Bharat's suggestion.

commit 1b3f7111d4c2607baaa2da0aab3b501f2d9a1426
Merge: 8f7904a 403f64b
Author: Chad Parry <github@chad.parry.org>
Date:   Wed Jul 20 21:02:56 2011 -0600

    Merge branch 'master' into rawphoto

commit 403f64bf2a
Author: Automatic Build Number Updater <bharat+gallery3_build_number_updater@menalto.com>
Date:   Tue Jul 12 21:44:14 2011 -0700

    Automated update of .build_number to 163 for branch master
    Last update: e8382b960a (1 commits ago)

commit 51726f9e4b
Author: Tim Almdal <tnalmdal@shaw.ca>
Date:   Tue Jul 12 21:44:40 2011 -0700

    Fix for ticket #1752.  Add an RSS field link for the current album. Or, in the case of a photo or movie, add a link to the rss field of the parent album.

commit e8382b960a
Author: Automatic Build Number Updater <bharat+gallery3_build_number_updater@menalto.com>
Date:   Mon Jun 27 22:27:04 2011 -0700

    Automated update of .build_number to 162 for branch master
    Last update: 40cda7fa3f (1 commits ago)

commit 1afbcafe0e
Merge: 40cda7f fc6c139
Author: Bharat Mediratta <bharat@menalto.com>
Date:   Mon Jun 27 22:26:41 2011 -0700

    Merge pull request #56 from alindeman/alindeman/1758

    [Fixes #1758] Link to themes codex page instead of modules codex page

commit 40cda7fa3f
Author: Automatic Build Number Updater <bharat+gallery3_build_number_updater@menalto.com>
Date:   Mon Jun 27 22:25:54 2011 -0700

    Automated update of .build_number to 161 for branch master
    Last update: 771de0a374 (1 commits ago)

commit aa08df7f0a
Merge: 771de0a 784c429
Author: Bharat Mediratta <bharat@menalto.com>
Date:   Mon Jun 27 22:25:46 2011 -0700

    Merge pull request #55 from alindeman/alindeman/1757

    [Fixes #1757] Redirect to root album if path comes in as main.php or index.php

commit fc6c1390d3
Author: Andy Lindeman <alindeman@gmail.com>
Date:   Mon Jun 27 08:25:50 2011 -0400

    [Fixes #1758] Link to themes codex page instead of modules codex page

commit 784c429070
Author: Andy Lindeman <alindeman@gmail.com>
Date:   Mon Jun 27 07:24:37 2011 -0400

    [Fixes #1757] Redirect to root album if path comes in as main.php or index.php

commit 8f7904ab62c71a7e4ee68762f936030b4dcb4ea1
Merge: e950573 771de0a
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Jun 25 14:12:39 2011 -0600

    Merge branches 'master' and 'rawphoto' into rawphoto

commit e95057337996351e49915d9f85d007d50103a4be
Author: Chad Parry <github@chad.parry.org>
Date:   Wed Jun 15 20:24:18 2011 -0600

    Merge branches 'rawphoto-squash' and 'rawphoto' into rawphoto
2011-07-21 00:11:52 -06:00
Chad Parry
1807e10a56 Merging some changes from rawphoto 2011-05-18 22:05:40 -06:00
Chad Parry
97c3ded2ba Better validation for uploaded files, especially where third-party modules might make a mistake.
Squashed commit of the following:

commit f2336a5aaa
Author: Chad Parry <github@chad.parry.org>
Date:   Wed May 18 21:56:10 2011 -0600

    Behave reasonably if the image cannot be resized.

commit e06b20738d
Author: Chad Parry <github@chad.parry.org>
Date:   Wed May 18 21:10:08 2011 -0600

    Adding an image representing a broken thumbnail.
    This image was derived from the equivalent Gallery2 icon. It uses the same washed-out gray color scheme as the Gallery3 missing_movie icon.

commit 4e3964527b
Author: Chad Parry <github@chad.parry.org>
Date:   Wed May 18 20:30:28 2011 -0600

    Initialize legal file arrays correctly.

commit e9862d8fbc
Author: Chad Parry <github@chad.parry.org>
Date:   Wed May 18 20:20:19 2011 -0600

    Correction for the merge conflict markers I accidentally committed.

commit 5e62d327a8
Author: Chad Parry <github@chad.parry.org>
Date:   Wed May 18 20:17:36 2011 -0600

    Expand the legal_file events to include separate photo and movie events, and to support MIME types.

commit f0bfd1fef0
Merge: 72f3fc4 db73413
Author: Chad Parry <github@chad.parry.org>
Date:   Wed May 18 19:49:25 2011 -0600

    Merge branch 'master' of https://github.com/gallery/gallery3 into rawphoto

    Conflicts:
    	modules/gallery/helpers/system.php
    	modules/gallery/tests/System_Helper_Test.php

commit db734130c5
Author: Automatic Build Number Updater <bharat+gallery3_build_number_updater@menalto.com>
Date:   Mon May 16 21:38:07 2011 -0700

    Automated update of .build_number to 153 for branch master
    Last update: 9aeb824aa1 (1 commits ago)

commit 8549ba30ca
Author: Chad Kieffer <ckieffer@gmail.com>
Date:   Mon May 16 22:37:09 2011 -0600

    Stop IE 9 album grid craziness. Thanks floridave. Fixes #1430.

commit 9aeb824aa1
Author: Automatic Build Number Updater <bharat+gallery3_build_number_updater@menalto.com>
Date:   Sun May 8 11:43:38 2011 -0700

    Automated update of .build_number to 152 for branch master
    Last update: 7c80e6ef84 (1 commits ago)

commit 57f7e42a12
Author: Bharat Mediratta <bharat@menalto.com>
Date:   Sun May 8 11:42:40 2011 -0700

    Add the item id to the print_proxy line so that we have a little more info
    about what the original was, and extend the timeout to 90 days from 10.
    Fixes #1733.

commit 7c80e6ef84
Author: Automatic Build Number Updater <bharat+gallery3_build_number_updater@menalto.com>
Date:   Fri May 6 11:48:43 2011 -0700

    Automated update of .build_number to 151 for branch master
    Last update: 5d09cbff04 (1 commits ago)

commit 80dda6f64f
Merge: 5d09cbf 46da011
Author: Bharat Mediratta <bharat@menalto.com>
Date:   Fri May 6 11:48:13 2011 -0700

    Merge pull request #52 from chadparry/tempnam

    Fixes #1732

commit 5d09cbff04
Author: Automatic Build Number Updater <bharat+gallery3_build_number_updater@menalto.com>
Date:   Thu May 5 21:53:39 2011 -0700

    Automated update of .build_number to 150 for branch master
    Last update: 011eaa6480 (1 commits ago)

commit d5a31ceede
Author: Tim Almdal <tnalmdal@shaw.ca>
Date:   Thu May 5 21:53:10 2011 -0700

    Fix for ticket 1275. Do the same checking as Kohana uses and don't worry about calling the utf8_encode routine.
    Corrected the error messages and also added a check to insure the XML Parser extension is loaded as we still need the utf8_encode function from it.

commit 011eaa6480
Author: Automatic Build Number Updater <bharat+gallery3_build_number_updater@menalto.com>
Date:   Thu May 5 14:53:06 2011 -0700

    Automated update of .build_number to 149 for branch master
    Last update: 05ecfda36b (1 commits ago)

commit 5bae21864f
Author: Bharat Mediratta <bharat@menalto.com>
Date:   Thu May 5 14:52:47 2011 -0700

    Follow-on to 6f916e49d5 -- don't make
    database calls if Gallery isn't installed, else we fail to bounce the
    user to the installer on fresh packages.  #1637.

commit 46da011bf6
Author: Chad Parry <github@chad.parry.org>
Date:   Wed May 4 17:51:00 2011 -0600

    Remove a newline I accidentally introduced.

commit 5c6c71ffcd
Merge: d2331bf 05ecfda
Author: Chad Parry <github@chad.parry.org>
Date:   Wed May 4 17:49:42 2011 -0600

    Merge branch 'master' into tempnam

commit d2331bf434
Author: Chad Parry <github@chad.parry.org>
Date:   Wed May 4 17:48:25 2011 -0600

    Simplified the temp_filename implementation and removed the mocks.

commit 72f3fc46f6
Author: Chad Parry <github@chad.parry.org>
Date:   Wed May 4 17:22:15 2011 -0600

    Avoid "self::" because Kohana can't override it.

commit 05ecfda36b
Author: Automatic Build Number Updater <bharat+gallery3_build_number_updater@menalto.com>
Date:   Mon May 2 21:38:50 2011 -0700

    Automated update of .build_number to 148 for branch master
    Last update: 97400b7815 (2 commits ago)

commit 229bfc5c7c
Author: Bharat Mediratta <bharat@menalto.com>
Date:   Mon May 2 21:37:04 2011 -0700

    Track and redirect core.DownloadItem requests properly.  This can
    happen if the G2 was imported with rewrite on, so the g2_url in the
    g2_map table has a shortened url, but then rewrite is disabled and the
    .htaccess mod_rewrite rules are sending over a &g2_view=core.DownloadItem
    request.  Fixes #1728.

commit 68370b92f5
Author: Bharat Mediratta <bharat@menalto.com>
Date:   Mon May 2 21:36:17 2011 -0700

    Map the G2 album highlight thumbnail derivative id to the G3 album's
    thumbnail.  Fixes #1729.

commit 13dbd3515b
Merge: f0f094c 97400b7
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 30 20:33:02 2011 -0600

    Merge branch 'master' of https://github.com/gallery/gallery3 into rawphoto

commit f0f094c3f7
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 30 20:22:49 2011 -0600

    Explain the conditional rename in item::save() with a comment.

commit 1b3a6b85c1
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 30 18:29:34 2011 -0600

    Improve the comment explaining why the data_file extension is important.

commit c3e8c1e3b5
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 30 18:12:56 2011 -0600

    The data_file field is public, so we don't need to supply an accessor method.

commit 0e844766ba
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 30 16:40:55 2011 -0600

    Change the signature of system::tempnam to something more appropriate for Gallery.

commit 5c9a3b3f39
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 23 21:19:47 2011 -0600

    Create a tempnam substitute that safely creates files with a given extension.

commit 2375a02e2c
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 30 16:40:55 2011 -0600

    Change the signature of system::tempnam to something more appropriate for Gallery.

commit a8ca9dcf9e
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 30 16:10:06 2011 -0600

    Change the name of the extensions helper to legal_file.

commit 7e61a01a96
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 30 16:08:49 2011 -0600

    Change the name of the extensions helper to legal_file.

commit 4c2b2ebd3f
Author: Chad Parry <github@chad.parry.org>
Date:   Wed Apr 27 20:52:35 2011 -0600

    Remove a newline at the end of the file that I accidentally introduced.

commit 6d564f185e
Merge: 7ff485f 4060640
Author: Chad Parry <github@chad.parry.org>
Date:   Wed Apr 27 20:35:58 2011 -0600

    Merge branch 'master' of https://github.com/gallery/gallery3 into rawphoto

commit 7ff485fa48
Author: Chad Parry <github@chad.parry.org>
Date:   Wed Apr 27 20:29:06 2011 -0600

    Move the extensions helpers out of the Kohana system directory and into their own Gallery Extensions class.

commit 26585fed03
Merge: 809567f c8f90e8
Author: Chad Parry <github@chad.parry.org>
Date:   Sun Apr 24 08:28:39 2011 -0600

    Merge branch 'master' of https://github.com/gallery/gallery3 into rawphoto

commit 809567f128
Author: Chad Parry <github@chad.parry.org>
Date:   Sun Apr 24 08:10:04 2011 -0600

    Expose the data file field.

commit fcb06bf175
Author: Chad Parry <github@chad.parry.org>
Date:   Sun Apr 24 00:45:12 2011 -0600

    Don't assign to the item->name field if the name is unchanged, because the save method will crash.

commit c6ef706d70
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 23 22:55:59 2011 -0600

    Preserve old data files long enough for them to be available to event handlers.

commit 0d6a3a3cfc
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 23 21:19:47 2011 -0600

    Create a tempnam substitute that safely creates files with a given extension.

commit e149cf7238
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 23 16:39:25 2011 -0600

    Support data files that change their extension and MIME type.

commit 6702104f57
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 23 16:35:00 2011 -0600

    Resolve an infinite recursion that happens when the path caches are updated during saving.

commit 944cb72eea
Merge: 567522b 5af74d4
Author: Chad Parry <github@chad.parry.org>
Date:   Fri Apr 22 14:10:42 2011 -0600

    Merge remote branch 'origin/master' into rawphoto

commit 567522bfa0
Author: Chad Parry <github@chad.parry.org>
Date:   Thu Apr 21 20:12:32 2011 -0600

    Add an event for when a new graphics toolkit is chosen.

commit 31ba081b79
Author: Chad Parry <github@chad.parry.org>
Date:   Thu Apr 21 02:06:53 2011 -0600

    Add an event that will collect all valid filename extensions.
2011-05-18 22:01:51 -06:00
Chad Parry
d2d37fe3f2 Results from a round of feedback with Bharat.
Squashed commit of the following:

commit 13dbd3515b
Merge: f0f094c 97400b7
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 30 20:33:02 2011 -0600

    Merge branch 'master' of https://github.com/gallery/gallery3 into rawphoto

commit f0f094c3f7
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 30 20:22:49 2011 -0600

    Explain the conditional rename in item::save() with a comment.

commit 1b3a6b85c1
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 30 18:29:34 2011 -0600

    Improve the comment explaining why the data_file extension is important.

commit c3e8c1e3b5
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 30 18:12:56 2011 -0600

    The data_file field is public, so we don't need to supply an accessor method.

commit 2375a02e2c
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 30 16:40:55 2011 -0600

    Change the signature of system::tempnam to something more appropriate for Gallery.

commit a8ca9dcf9e
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 30 16:10:06 2011 -0600

    Change the name of the extensions helper to legal_file.

commit 7e61a01a96
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 30 16:08:49 2011 -0600

    Change the name of the extensions helper to legal_file.

commit 4c2b2ebd3f
Author: Chad Parry <github@chad.parry.org>
Date:   Wed Apr 27 20:52:35 2011 -0600

    Remove a newline at the end of the file that I accidentally introduced.

commit 6d564f185e
Merge: 7ff485f 4060640
Author: Chad Parry <github@chad.parry.org>
Date:   Wed Apr 27 20:35:58 2011 -0600

    Merge branch 'master' of https://github.com/gallery/gallery3 into rawphoto

commit 7ff485fa48
Author: Chad Parry <github@chad.parry.org>
Date:   Wed Apr 27 20:29:06 2011 -0600

    Move the extensions helpers out of the Kohana system directory and into their own Gallery Extensions class.

commit 26585fed03
Merge: 809567f c8f90e8
Author: Chad Parry <github@chad.parry.org>
Date:   Sun Apr 24 08:28:39 2011 -0600

    Merge branch 'master' of https://github.com/gallery/gallery3 into rawphoto

commit 809567f128
Author: Chad Parry <github@chad.parry.org>
Date:   Sun Apr 24 08:10:04 2011 -0600

    Expose the data file field.

commit fcb06bf175
Author: Chad Parry <github@chad.parry.org>
Date:   Sun Apr 24 00:45:12 2011 -0600

    Don't assign to the item->name field if the name is unchanged, because the save method will crash.

commit c6ef706d70
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 23 22:55:59 2011 -0600

    Preserve old data files long enough for them to be available to event handlers.

commit 0d6a3a3cfc
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 23 21:19:47 2011 -0600

    Create a tempnam substitute that safely creates files with a given extension.

commit e149cf7238
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 23 16:39:25 2011 -0600

    Support data files that change their extension and MIME type.

commit 6702104f57
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 23 16:35:00 2011 -0600

    Resolve an infinite recursion that happens when the path caches are updated during saving.

commit 944cb72eea
Merge: 567522b 5af74d4
Author: Chad Parry <github@chad.parry.org>
Date:   Fri Apr 22 14:10:42 2011 -0600

    Merge remote branch 'origin/master' into rawphoto

commit 567522bfa0
Author: Chad Parry <github@chad.parry.org>
Date:   Thu Apr 21 20:12:32 2011 -0600

    Add an event for when a new graphics toolkit is chosen.

commit 31ba081b79
Author: Chad Parry <github@chad.parry.org>
Date:   Thu Apr 21 02:06:53 2011 -0600

    Add an event that will collect all valid filename extensions.
2011-04-30 21:33:20 -06:00
Chad Parry
b875368167 This patch helps provide raw photo support with some small changes to the framework. Items can now change their extension and MIME type.
Squashed commit of the following:

commit 4c2b2ebd3f
Author: Chad Parry <github@chad.parry.org>
Date:   Wed Apr 27 20:52:35 2011 -0600

    Remove a newline at the end of the file that I accidentally introduced.

commit 6d564f185e
Merge: 7ff485f 4060640
Author: Chad Parry <github@chad.parry.org>
Date:   Wed Apr 27 20:35:58 2011 -0600

    Merge branch 'master' of https://github.com/gallery/gallery3 into rawphoto

commit 7ff485fa48
Author: Chad Parry <github@chad.parry.org>
Date:   Wed Apr 27 20:29:06 2011 -0600

    Move the extensions helpers out of the Kohana system directory and into their own Gallery Extensions class.

commit 26585fed03
Merge: 809567f c8f90e8
Author: Chad Parry <github@chad.parry.org>
Date:   Sun Apr 24 08:28:39 2011 -0600

    Merge branch 'master' of https://github.com/gallery/gallery3 into rawphoto

commit 809567f128
Author: Chad Parry <github@chad.parry.org>
Date:   Sun Apr 24 08:10:04 2011 -0600

    Expose the data file field.

commit fcb06bf175
Author: Chad Parry <github@chad.parry.org>
Date:   Sun Apr 24 00:45:12 2011 -0600

    Don't assign to the item->name field if the name is unchanged, because the save method will crash.

commit c6ef706d70
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 23 22:55:59 2011 -0600

    Preserve old data files long enough for them to be available to event handlers.

commit 0d6a3a3cfc
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 23 21:19:47 2011 -0600

    Create a tempnam substitute that safely creates files with a given extension.

commit e149cf7238
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 23 16:39:25 2011 -0600

    Support data files that change their extension and MIME type.

commit 6702104f57
Author: Chad Parry <github@chad.parry.org>
Date:   Sat Apr 23 16:35:00 2011 -0600

    Resolve an infinite recursion that happens when the path caches are updated during saving.

commit 944cb72eea
Merge: 567522b 5af74d4
Author: Chad Parry <github@chad.parry.org>
Date:   Fri Apr 22 14:10:42 2011 -0600

    Merge remote branch 'origin/master' into rawphoto

commit 567522bfa0
Author: Chad Parry <github@chad.parry.org>
Date:   Thu Apr 21 20:12:32 2011 -0600

    Add an event for when a new graphics toolkit is chosen.

commit 31ba081b79
Author: Chad Parry <github@chad.parry.org>
Date:   Thu Apr 21 02:06:53 2011 -0600

    Add an event that will collect all valid filename extensions.
2011-04-28 19:41:44 -06:00
Bharat Mediratta
91c83874e5 Fix a bug introduced in 526859d960 where
we changed the behavior of the slug code and included the file
extension, not just the name.  This broke
Item_Model_Test::move_photo_with_conflicting_target_gets_uniqified_test
so yay for unit tests!  #1668
2011-04-25 22:15:34 -07:00
Bharat Mediratta
526859d960 Do simple transliteration when converting filenames to slugs, but check
to see if the transliteration module is available and use a more complex
transliteration if possible.  Fixes #1668.
2011-04-22 13:57:46 -07:00
Bharat Mediratta
423daa52d5 Update copyright to 2011. 2011-01-21 23:01:06 -08:00
Jérémy Subtil
0d7e951aa5 Moved item_Model::get_position() method to the Item helper. It now calls the viewable() method on every query. 2011-01-09 12:14:46 +01:00
Bharat Mediratta
e2b0f92007 Keep Item_Model::scale_dimensions from upscaling. Fixes #1579. 2011-01-05 21:05:20 -08:00
Joe7
7ce902d373 Removed accidental whitespace 2011-01-03 11:01:09 -08:00
Joe7
336632fea0 Keep view counters of all item types accurate
Added common increment_view_count() func in item model for reuse
2011-01-03 11:01:02 -08:00
Bharat Mediratta
7e31f97b4c Improve Item_Model::as_restful_array() to take an array of fields so
that we only return the fields we care about.  This improves
performance when retrieving large numbers of items.  Fixes #1536.
2010-12-16 20:37:00 -08:00
Bharat Mediratta
cd48b89f31 Consolidate all the random code into a random helper that offers:
random::hash()
  random::string()
  random::percent()
  random::int()

So that we don't have lots of different ways to get random values all
over the code.  Follow-on to #1527.
2010-12-15 14:57:00 -08:00
Bharat Mediratta
45c63f4d11 Use mt_rand() instead of rand() since it provides better portability.
Fixes #1527.
2010-12-15 12:48:56 -08:00
Bharat Mediratta
79740a2c77 Move photo/movie file extension validation into the model. Fixes #1524. 2010-12-14 21:19:25 -08:00
Bharat Mediratta
8d030cea64 Fix a bug where simultaneous deletes of the same item can result in it
deleting the first item row in the database.  The root issue is a bug
in Kohana that's addressed in dca9b5f3fc
but in this change we deal with the fact that reloading an item can
result in an instance of the item that's unloaded.  In those cases, we
should just ignore it and move on.  Fixes #1489.
2010-11-18 09:52:40 -08:00
Bharat Mediratta
e87c502ede Tie the image cachebuster to the file mtime instead of
Item_Model::$updated since we want the url to be stable whenever
possible.  Fixes #1482.
2010-11-09 12:48:07 -08:00
Bharat Mediratta
d503513eca Create item_before_create and item_before_update events, and make
Item_Model::data_file public.  This allows us to intercept and tweak
data files before saving the model which enables the max_size module.
2010-11-06 21:54:28 -07:00
Bharat Mediratta
f01fad1cd0 Deal in integers when doing aspect ratio operations. Fixes #1470. 2010-10-31 12:21:06 -07:00
Bharat Mediratta
dff1a53696 All modules should be named Xxx_Core for extensibility. Fixes #1458. 2010-10-25 21:05:31 -07:00
Bharat Mediratta
85637a0826 Fix a bug introduced recently in
f84c4a6192 where we were generating bad
SQL.  If we're checking for a conflict on a new item, the id is null
and we were doing a comparison that resulted in "id <> NULL" which
won't work -- in that case we need "id IS NOT NULL".

Fixes #1393.
2010-09-23 20:45:27 -07:00