Commit Graph

69 Commits

Author SHA1 Message Date
Sean Harvey
55eda363f4 MINOR Added more allowed extensions to File::$allowed_extensions
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@100740 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:51 +13:00
Sean Harvey
74d5761a3c API CHANGE Removed deprecated File::loadUploaded(), please use Upload directly instead!
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@100495 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:46 +13:00
Ingo Schommer
d616f9b8bb MINOR Localized File->uploadMetadataFields()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@99111 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:37 +13:00
Ingo Schommer
d404a53569 FEATURE set file metadata on upload. (from r97780)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@99106 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:37 +13:00
Andreas Piening
7de75919ac MINOR: fixed setName()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@98282 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:25 +13:00
Normann Lou
0f810b9a3f BUGFIX: missing comma
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@97937 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:18 +13:00
Normann Lou
edaf66d242 MINOR: add flv (flash file) to File::$allowed_extensions
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@97936 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:18 +13:00
Normann Lou
398f21a678 BUGFIX: can't upload swf file in admin/assets (open ticket #4999)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@97935 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:18 +13:00
Andrew Short
8361a41c16 MINOR: Don't include files and folders starting with an underscore in the asset system.
MINOR: Automatically rename files and folders beginning with an underscore.

From: Andrew Short <andrewjshort@gmail.com> (from r97400)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@97435 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:12 +13:00
Sean Harvey
e77964a5b9 API CHANGE #3600 Inconsistency in File::getURL() which returns an absolute URL, when it should be relative - please use getAbsoluteURL() instead for old behaviour
API CHANGE #3600 Image no longer has an explicit getURL() method, instead it inherits getURL() from File which returns a relative URL


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@96988 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:08 +13:00
Sam Minnee
67f827cb5a BUGFIX: Apply file extension restrictions to extensions properly. (from r93531)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@96761 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:07 +13:00
Sam Minnee
da2f90d187 BUGFIX: Changed default config to restrict file-upload types to ADMINs, since it's protecting against security holes. (from r93327)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@96759 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:06 +13:00
Sam Minnee
3c88905299 BUGFIX: Add a default list of allowed extensions so that the CMS works reasonably out of the box.
BUGFIX: Allow files that don't have an extension (most notably folders)
BUGFIX: Ensure that file URL rewriting works if you rename a page twice without publishing.
BUGFIX: Ensure that the page doesn't go green after URLs are rewritten
ENHANCEMENT: Recognise HTTP_X_FORWARDED_HOST header and use that in place of HTTP_HOST (from r93148)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@96752 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:06 +13:00
Sam Minnee
5930458997 MINOR moved allowed_extensions and friends to the model layer (from r92046)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@96743 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:05 +13:00
Sam Minnee
b4dc73e002 MINOR moved File validation to the model (from r92044)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@96742 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 14:18:05 +13:00
Sam Minnee
aaeaf6ccb2 BUGFIX: Fixed image link rewriting and added a test. (from r89011)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89208 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-15 22:40:06 +00:00
Sam Minnee
a920b7689f BUGFIX: Fix image tracking not working cross subsite (from r88008)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89177 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-15 22:21:02 +00:00
Sam Minnee
f84180813f #150 - Pages with similar content
#148 - Stable against restructures (from r87251)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@89174 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-10-15 22:19:25 +00:00
Geoff Munn
9131df8061 MINOR FIX: full text column now named
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@86517 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-09-17 00:11:20 +00:00
Sean Harvey
f7dc370b16 BUGFIX #4486 Make use of DataObject::get_by_id() in File::getRelativePath() instead of building ID query manually in a get_one()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@84843 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-08-19 23:39:39 +00:00
Sam Minnee
6a52153b9f BUGFIX #4285: Fixed application of decorators when add_extension not used.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@81676 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-07-13 03:56:26 +00:00
Sam Minnee
547a9b700d BUGFIX #4303: Fixed File::CMSThumbnail() HTML
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@80184 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-27 03:30:47 +00:00
Sam Minnee
e0fbc7ac83 BUGFIX: Added explicit DataObjectDecorator::load_extra_statics() calls as a workaround for issues with extensions defined directly in-object.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@79720 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-06-22 02:42:42 +00:00
Sean Harvey
9044d7a141 MINOR Fixed misleading information in File::onBeforeWrite() phpDoc
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@76546 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-05-11 05:34:56 +00:00
Sean Harvey
13b358a8dd Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75582 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-04-29 00:07:39 +00:00
Sean Harvey
76b5adc979 Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@75579 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-04-28 23:52:15 +00:00
Sean Harvey
69f1595cc8 BUGFIX Fixed possible SQL injection in file name part for File::find()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@73436 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-03-20 01:36:19 +00:00
Andrew O'Neil
60f75c5ca4 Merged changes from 2.3 branch
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@71172 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-02-01 23:49:53 +00:00
Geoff Munn
fe0a640c39 API CHANGE: fulltext and unique indexes are now arrays
API CHANGE: db/build now no longer notifies you of changes which haven't actually happened.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@69303 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-12-17 00:40:24 +00:00
Ingo Schommer
d26f08b481 MINOR merged branches/2.3 into trunk
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@67465 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-12-04 22:38:32 +00:00
Sam Minnee
96c5be8252 Updating queries to be more DB agnostic
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66507 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-24 09:31:14 +00:00
Sam Minnee
93438e0be2 API CHANGE: Adding double quotes to all table and field references (a work in progress)
API CHANGE: DataObject::get()'s GROUP BY clause is only generated for MySQL as it needs to be improved for other databases to accept it.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66427 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-23 23:28:16 +00:00
Sam Minnee
a3d3fb65a9 Updated SQL queries to be ansi compatable
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66401 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-23 00:31:06 +00:00
Sam Minnee
2984355f43 Merged branches/2.3 into trunk
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@66395 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-22 03:33:00 +00:00
Ingo Schommer
cfde8adaee API CHANGE Removed Folder->userCan*() and File->userCan*()permissions and added more consistent behaviour with Folder->can*() and File->can*()
ENHANCEMENT Allowing decoration of can*() methods in File and Folder

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65452 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-07 12:17:42 +00:00
Ingo Schommer
3edc358ead ENHANCEMENT Added fieldLabels() overloading to various DataObject subclasses. Use this method instead of directly calling _t() in getCMSFields(), and use fieldLabel('MyField') to get the label for a specific FormField. This way, we can transparently support formfield scaffolding and re-use the labels for search fields automatically.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@65072 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-11-02 20:04:10 +00:00
Ingo Schommer
252f739919 API CHANGE Removed deprecated File->setMaxFileSize(), use Upload class
API CHANGE Removed deprecated File->getMaxFileSize(), use Upload class
API CHANGE Removed File::sync(), use Filesystem::sync()
API CHANGE Removed deprecated File::fixfiles()
API CHANGE Removed deprecated File::loadContent(), use Upload class
API CHANGE Removed deprecated File::loadallcontent(), use Upload class

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64402 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-16 11:05:57 +00:00
Sean Harvey
31df9f440f ENHANCEMENT Added additional known file types, for audio and video files
MINOR Tweaked text of file type descriptions slightly

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@64356 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-10-16 03:55:33 +00:00
Ingo Schommer
9371f4688b ENHANCEMENT Introduced constants for system paths like /sapphire in preparation for a more flexible directory reorganisation. Instead of hardcoding your path, please use the following constants: BASE_PATH, BASE_URL, SAPPHIRE_DIR, SAPPHIRE_PATH, CMS_DIR, CMS_PATH, THIRDPARTY_DIR, THIRDPARTY_PATH, ASSETS_DIR, ASSETS_PATH, THEMES_DIR, THEMES_PATH
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63154 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-09-27 16:02:38 +00:00
Ingo Schommer
f0feea5109 API CHANGE Removed useless File->test() method
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@63077 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-09-25 12:38:36 +00:00
Sam Minnee
f2c619d10c FEATURE: Files & Images tree now shows filename rather than meta-data title, to make it easier to find the file you're looking for
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@62284 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-09-12 01:05:11 +00:00
Sam Minnee
5fb17f1eca Improved File tests
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@61462 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-08-25 01:42:27 +00:00
Hayden Smith
19da6e3128 Refactored [47088]: File::getFullPath now compares the filename with Director::baseFolder and returns filename if the filename stars with Director::baseFolder.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60529 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-08-12 22:26:52 +00:00
Andrew O'Neil
1107757128 MINOR: #2445 - Function getFilename in File.php cehcks for Name, but returns Filename (Blynx)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@56944 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-06-25 05:52:58 +00:00
Ingo Schommer
60860cc1b9 MINOR Unified @package PHPdoc (added where missing, removed duplicates)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@56212 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-06-15 13:33:53 +00:00
Ingo Schommer
d344eef293 Merged revisions 54204 via svnmerge from
svn://svn.silverstripe.com/silverstripe/modules/sapphire/branches/2.2.0-mesq

........
  r54204 | ischommer | 2008-05-09 10:19:21 +1200 (Fri, 09 May 2008) | 1 line
  
  API CHANGE Made deleteDatabaseOnly() public (used in Filesystem::sync())
........


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@55071 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-05-24 01:21:04 +00:00
Sam Minnee
091c0afc2e Merged revisions 52293 via svnmerge from
http://svn.silverstripe.com/open/modules/sapphire/branches/2.2.2

........
  r52293 | aoneil | 2008-04-08 12:03:43 +1200 (Tue, 08 Apr 2008) | 2 lines
  
  don't cache in overridden instance_get(), as the fields are different for subclasses
........


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@53509 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-04-26 06:47:29 +00:00
Ingo Schommer
00f95679ce Merged revisions 47621 via svnmerge from
svn://svn.silverstripe.com/silverstripe/modules/sapphire/branches/2.2.0-mesq

........
  r47621 | ischommer | 2008-01-04 21:44:07 +1300 (Fri, 04 Jan 2008) | 1 line
  
  added get_file_extension()
........


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@52398 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-04-09 11:08:58 +00:00
Ingo Schommer
b465a46bcc API CHANGErefactored upload functionality from File into newly created Upload class
API CHANGE deprecated some File functions and attributes
API CHANGE moved management function from File to Filesystem and added permission checks: sync(), loadContent(), fixfiles(), moverootfilesto()
API CHANGE deprecated use of File->loadUploaded()
ENHANCEMENT added filesize and extension validation to AssetAdmin and FileField
FEATURE added tests for Upload class

Merged revisions 47617 via svnmerge from 
svn://svn.silverstripe.com/silverstripe/modules/cms/branches/2.2.0-mesq

........
  r47617 | ischommer | 2008-01-04 19:20:29 +1300 (Fri, 04 Jan 2008) | 5 lines

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@52205 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-04-06 08:20:13 +00:00
Ingo Schommer
e7a683c0c4 Merged revisions 51257 via svnmerge from
svn://svn.silverstripe.com/silverstripe/modules/sapphire/branches/2.2.0-mesq

........
  r51257 | ischommer | 2008-03-18 12:50:03 +1300 (Tue, 18 Mar 2008) | 2 lines
  
  ENHANCEMENT Deprecated Image->URL(), changed to Image->getURL() to be consistent with File class
  FEATURE File->getAbsoluteURL()
........


git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@51251 467b73ca-7a2a-4603-9d3b-597d59a354a9
2008-03-17 23:50:18 +00:00