Commit graph

224 commits

Author SHA1 Message Date
Aaron Schulz
14863b9aa5 Cleaned up some references to FSRepo in code and comments. This should have no noticeable functional changes. 2011-12-20 19:25:23 +00:00
Aaron Schulz
5275f9b097 Merged FileBackend branch. Manually avoiding merging the many prop-only changes SVN likes to sprinkle in (easy to spot from the change list). Did not add SwiftFileBackend.php as it still is in development. 2011-12-20 03:52:06 +00:00
Jeroen De Dauw
49cdca93be add missing deprecation notices and added deprecation version to existing ones 2011-12-13 05:19:05 +00:00
Jan Gerber
0095c08ed2 Use database to track uploaded chunks and concatenate at the end.
with i18n documentation dont break phpunit

follow up r93720
2011-11-30 14:56:40 +00:00
Roan Kattouw
e83bb90997 Revert r104659 and its followup r104665: break the unit tests with a fatal error. This cripples our CI system, we can't detect new failures this way. 2011-11-30 13:54:35 +00:00
Jan Gerber
d70c169b90 Use database to track uploaded chunks and concatenate at the end.
follow up r93720
2011-11-30 08:55:16 +00:00
Roan Kattouw
d14f8c89a0 (bug 1672) Add $wgDisableUploadScriptChecks to allow disabling of the HTML/JS detection for uploads. Patch by Emufarmers 2011-11-20 18:57:47 +00:00
Jure Kajzer
be3bbfc539 * Added getInfinity to DatabaseOracle
* Block - replaced 'infinity' strings with DB->getInfinity calls
* UploadStash - added sequence value generation for ID
2011-11-10 07:41:12 +00:00
Mark A. Hershberger
a40a045f5f w/s fixup 2011-11-03 16:47:42 +00:00
Sam Reed
9d41b95053 Kill various unused variables
Comment some out also

Add some bits of documentation
2011-10-29 01:17:26 +00:00
Sam Reed
0c8f30b3c4 Few bits of documentation 2011-10-16 22:01:10 +00:00
Sam Reed
27665d27ae Update some deprecated code
Documentation

Fix "/*" comments to "/**"

Flesh out some missing returns, change some return types
2011-10-14 21:18:38 +00:00
Bryan Tong Minh
f3fc3c7f43 Follow-up r98430, use dedicated error message for filename too long error. Adds 'filename-toolong' message. 2011-10-07 18:20:55 +00:00
Bryan Tong Minh
c48b61c01b (bug 30202) Restrict file names on upload to 240 bytes, because wfTimestamp( TS_MW ) . '!' . $fileName should fit in oi_archive_name, which is 255 bytes, and also the maximum file name length on many file systems is 255 bytes.
Commit to fix UploadTest to use @dataProvider will follow
2011-09-29 19:00:45 +00:00
Brion Vibber
a16a028057 * (bug 29154) Allow upload-by-URL to follow HTTP redirects 2011-09-22 01:15:06 +00:00
Ian Baker
bfc89c6ade Fixed incorrect userId reference 2011-09-14 17:23:09 +00:00
Aaron Schulz
15ae38d52f Partial revert of r65898 (bug 27700). Callers should check 'create' and Title will internally check the proper subpermission depending on the title namespace. 2011-09-08 19:28:03 +00:00
Ian Baker
4840027b4d UploadFromStash::stashSession returned an object instead of a file key, which broke stashing in SpecialUpload in some cases.
Fixes bug 30505
2011-08-26 23:17:43 +00:00
Ian Baker
000080990d Two bugs:
1. When the user isn't passed to UploadFromStash::__construct(), it would break when it shouldn't.
2. When stashing files, sometimes an instance of UnregisteredLocalFile would be returned instead of UploadStashFile
2011-08-18 23:36:24 +00:00
Ian Baker
a26afff4e0 Cleaning up little things, updates to code clarity, documentation fixes per Catrope's suggestions.
followup to r94536, r94592, r94594
2011-08-16 17:57:32 +00:00
Brian Wolff
9ccad8e8b3 follow-up r88171 - fix fatal if suggested filename has illegal character in it.
Check to make sure the title object actual exists, before checking its namespace,
since alll the does this have illegal chars check is done after the does it
start with file: check.

For future note though, when using upload by url feature, the suggested
destination name when you put http://upload.wikimedia.org/wikipedia/commons/e/e0/Petrorhagia_prolifera_%281%29.JPG is illegal, which is probably not very user-friendly (filed as bug 30390)
2011-08-16 05:37:18 +00:00
Ian Baker
53f3c48a95 Removed the ability to pass a key into stashFile(), which simplifies the stash row creation a great deal.
Updated UploadFromUrlJob to properly use the database stash
followup to r92200
2011-08-15 23:58:40 +00:00
Ian Baker
36babe9a7d Removed complex replag handling, now just query master when record isn't present on slave.
followup to r92009
2011-08-15 23:40:57 +00:00
Ian Baker
6410788a46 checking for existence of mLocalFile in stashFile() was inverted
followup to r94536
2011-08-15 18:19:54 +00:00
Ian Baker
6b292f7804 cleaned up database query, doesn't have to be aware of column names anymore (thanks Catrope!)
followup to r92009
2011-08-15 18:17:51 +00:00
Ian Baker
9cb2d4743a Fixed incorrect usage of || operator, added test
removed spurious use of empty()
listFiles() was broken, now works
followup to r92009
2011-08-15 18:10:10 +00:00
Ian Baker
54a8faa0cf Fixed bug where global wgUploadStashMaxAge wasn't used, removed redundant defaults. Followup to r93476 2011-08-04 21:19:08 +00:00
Neil Kandalgaonkar
40f4c33e74 added a few comments about noAuth 2011-08-02 20:17:13 +00:00
Jan Gerber
65c85b5072 Extend upload api adding an option to upload files in chunks,
using UploadStash to track the unfinished upload.
2011-08-02 10:13:56 +00:00
Ian Baker
26036eb601 Changed stash age parameter from a constant to a config option, switched to seconds for consistency.
followup to r92030
2011-07-29 18:46:24 +00:00
Ian Baker
26399eec9a Changed storeResult to storeStatus (more informative), removed leftover stack trace call. Followup to r92009 2011-07-25 16:55:19 +00:00
Sam Reed
896f05efde Trim trailing whitespace
Add documentation

Remove unused variables

Remove an extract from ImageFunctionsTest
2011-07-24 21:36:04 +00:00
Mark A. Hershberger
b526cd0d68 Bug #29874 - Image extension strict whitelist handling is inconsistent
Patch from Dan Collins
2011-07-18 18:05:45 +00:00
Ian Baker
1a526e0a9f No longer using the content hash as a file key. This solves a concurrency problem when multiple people use the same account to upload from the same set of files. Each stashed file is now a unique and beautiful snowflake, and the content-based deduping that comes at the end of the process can sort it out. 2011-07-15 18:33:31 +00:00
Chad Horohoe
9d22f7297c Slightly more informative error message when passed a bogus key (rather than property of non-object) 2011-07-15 16:59:38 +00:00
Chad Horohoe
c3dc89e840 Stylize 2011-07-15 15:54:14 +00:00
Ian Baker
9b50e7ade7 properly handle the case where a file disappears during the uploadwizard process
remove database records for files that move out of the stash
2011-07-14 23:01:00 +00:00
Ian Baker
f776cbe630 fixed a condition where re-uploading a file that's already stashed causes breakage. This mirrors the previous session-based behavior as closely as possible. 2011-07-14 21:33:09 +00:00
Ian Baker
c2e2c8270e Added us_status column for future expansion re Bryan's suggestion
Implemented changes suggested in code review on r92009:
 constructor bug handling passed repo/stash
 up-to-date timestamp generation
 fetching db handle from repo
 iterating over select results according to convention
 changed uploadstash.us_media_type to enum to mirror image.img_media_type
 removed (most) new references to $wgUser, instead using ApiBase::createContext to find the user
2011-07-13 19:08:51 +00:00
Ian Baker
34126b546d Added maintenance script for cleaning up abandoned uploads
Added methods for working with UploadStash without authenticating, for maintenance script
2011-07-13 00:11:02 +00:00
Ian Baker
9d4fd0c567 Refactored UploadStash and related classes to use the database for file metadata storage instead of the session, see bug 26179
Tweaked the UploadWizard to work properly with the new backend code, updated tests
2011-07-12 21:11:43 +00:00
Chad Horohoe
17492955f6 public static 2011-07-06 17:15:04 +00:00
Russ Nelson
2fe1420f43 UploadStashFile::__construct() can't assume that the mwrepo-produced paths match the temp zone. 2011-06-28 22:00:21 +00:00
Matěj Grabovský
5b11098eaf Follow-up r90369: Add third parameter to filetype-unwanted-type (for PLURAL)
Also use params() insted of numParams() on an ocassion, as it's not really needed there
2011-06-22 13:35:24 +00:00
Platonides
fd4b5f305f Follow up with the problem noted in r90530.
You can't pass the result of a function to reset(), since it expects a reference.

Those random errors show now as UploadStashFileException: error storing file in 
'tests/phpunit/includes/upload/bug29408.': fileexistserror images/temp/0/02/20110621151405!bug29408.
because it gets run twice in the same second.
2011-06-21 15:13:03 +00:00
Matěj Grabovský
3533cc1921 (bug 29325) Setting $wgStrictFileExtensions to false gives incorrect warning
Also use Language::commaList
2011-06-18 21:27:24 +00:00
Bryan Tong Minh
9bbe0bc566 (bug 29408) Key 'something.' is not in a proper format
Fixed this by relaxing the stash key regex. For some files MediaWiki is simply not able to guess an extension. If the wiki has been configured to allow them, we should just let them pass in the stash as well.
2011-06-18 14:56:14 +00:00
Krinkle
32d29b93ea (bug 28556) Remove MacBinary
* IE5 for Mac is history.
2011-06-13 19:00:49 +00:00
Sam Reed
ba2c3a793d And even more documentation in various files 2011-05-29 14:25:20 +00:00
Sam Reed
b15737fa83 And even more documentation, the last of this batch 2011-05-28 19:00:01 +00:00