Commit graph

198 commits

Author SHA1 Message Date
Tim Starling
85fa7504e6 * Split off ultimate base class FileRepo from FSRepo
* Use rawurlencode() for paths instead of urlencode()
* Moved functionality of LocalFile::loadFromFile() to a public static function. This allows Special:Upload to entirely avoid loading metadata from the (potentially remote) store. Changed purgeMetadataCache() to use loadFromDB() instead of loadFromFile().
* Redefined private virtual URLs, giving them a repo name component instead of a host.
* Moved is_writable($wgUploadDirectory) in SpecialUpload.php to the repo
* Added some filename validation to the FSRepo's store/publish
* Changed store and publish to use relative destinations instead of absolute, as was documented
* Deprecated File::recordUpload()! Now use upload() to do both publish and record. Moved the UI bits to SpecialUpload.
* Create a null revision on reupload
* Changed most of the member variable names in UploadForm. $this->mUpload followed by some ambiguous word or abbreviation was not a good naming convention. Also did some reformatting and assorted code cleanup.
2007-06-16 02:55:25 +00:00
Tim Starling
e173697025 Don't delete images in foreign repositories. Also fixed image counter downwards drift bug. 2007-06-04 21:03:36 +00:00
Brion Vibber
078a5ad895 aaaand one more 2007-06-04 15:58:16 +00:00
Brion Vibber
eb35eaa785 fix to fix for calling convention :D 2007-06-04 15:57:22 +00:00
Tim Starling
d25024f93f Fix calling convention to makeThumbLinkObj() 2007-06-04 15:52:22 +00:00
Tim Starling
ed4303922f Merged filerepo-work branch:
* Added support for configuration of an arbitrary number of commons-style file repositories.
* Split Image.php into filerepo/File.php and filerepo/LocalFile.php
* Renamed Image::getImagePath() to File::getPath()
* Added initial support for timestamp-based file fetching (OldLocalFile), to be expanded upon by aaron.
* Changed the interface for Image/File object creation: use wfFindFile() or wfLocalFile() depending on semantics
* ImageGallery::add() now accepts a title object as the first parameter
* Moved file handling operations on upload from SpecialUpload to File
* Removed path-related functions from ImageFunctions.php. Removed static path accessors from File. 
* Added a Content-Disposition header to thumb.php output
* Improved thumb.php error handling
* Updated the unit test suite to kind of partially work with modern computers. RunTests.php doesn't work just yet. Fixed an actual regression that the test suite detected -- moved some defines to Defines.php where they will be loaded consistently.
2007-05-30 21:02:32 +00:00
Aaron Schulz
428da92d01 *A bit of cleanup for bug 5057, make upload link consistent with reupload-own right checking 2007-05-22 02:22:59 +00:00
Magnus Manske
46a6e4efe6 New hook 'ImageOpenShowImageInlineBefore' for upcoming extension 2007-05-16 19:52:22 +00:00
Brion Vibber
67c4772b67 Fix regression causing incorrect image data to be stored in the oldimage table.
The call to upgradeRow() in purgeMetadataCache(), indirectly called during upload, caused data for the new file to be written into the 'image' table in the database before migration from 'image' to 'oldimage'. Thus data for the new file was recorded as belonging to the old file.
Have replaced this call with a call to loadFromFile(), so the new data goes only into cache
at this time, and won't get written to the database until after.
The 'purge' action in ImagePage now explicitly calls the upgradeRow() function in addition to cache purging... is it needed elsewhere?
This whole mess still stinks of race  conditions, though. Sigh.
2007-05-04 19:39:19 +00:00
Aaron Schulz
62c20a7563 *Replace calls to $this->blockedIPpage() with $wgOut->blockedPage() since the former refers to a non-existent function in EditPage. 2007-05-04 19:17:36 +00:00
Tim Starling
ac14a8a6b7 Use makeKnownLinkObj() instead of makeLinkObj() for multipage prev/next links. Image pages do not need to exist to work. 2007-05-04 14:27:52 +00:00
Brion Vibber
f83d881fb1 Normalize escaping for some image page messages:
* HTML-escape the image filename when made into an original-size link for HTML purity
* Use inline wiki parsing instead of raw HTML for show-big-image-thumb and file-nohires messages. This is cleaner (less raw HTML yay) while avoiding breaking the "<small>" tags which are for some reason in the defaults and likely any customizations (sigh) and will allow the pixel values to have localized number formatting if appropriate parser function is used
2007-04-30 17:41:12 +00:00
Raimond Spekking
fd100716f3 Fix regression, broken since r21411:
Wrong messages were shown beneath small images at image description page.
2007-04-27 22:04:01 +00:00
Nick Jenkins
bd23ec29c6 Doc tweaks:
* Seems like an opportune time to introduce "@addtogroup Media" documentation tags.
* Merge "@addtogroup Metadata" (used by Exif.php) into "@addtogroup Media".
* Few more moving comment blocks to above classes.
2007-04-24 06:53:31 +00:00
Tim Starling
b15d8cffc4 * Introduced media handler modules for file-type specific operations: thumbnailing, img_metadata, capabilities, etc.
* Deprecated $wgUseImageResize, thumbnailing will be enabled unconditionally.
* Fixed interaction of page parameter to ImagePage with the HTML file cache
* Improved error reporting for image thumbnailing
* Fixed MIME type for SVG files, will be silently changed from image/svg to image/svg+xml after loading from the database.
* Workaround for djvutoxml bug #1704049 (poor performance). Use djvudump instead.
* Fixed odd behaviour in ImagePage on DjVu thumbnailing errors
* Improved error reporting for image thumbnailing
* Added sharpening option for ImageMagick thumbnailing
* Removed Image::selectPage(), added page parameters to getWidth() and getHeight(), deprecated Image::renderThumb() and Image::getThumbnail()
* Changed default contents of img_metadata to empty string instead of a:0:{}
* Moved responsibility for respecting $wgGenerateThumbnailOnParse from the UI to Image.php
2007-04-20 12:31:36 +00:00
Tim Starling
a7c8d93b7e * Fix extension of DJVU output
* Specify output type in ImageMagick SVG rendering command line
* Make some Image functions static, for the benefit of WebStore.
* Fixed SVG MIME type, will be image/svg+xml from now on with both accepted.
2007-03-31 17:15:00 +00:00
Brion Vibber
629435171a * (bug 9411) Fix for shared image descriptions using query-string titles
Extracted URL-query-append logic from Title to wfAppendQuery(), using this in two places now.
2007-03-26 14:33:08 +00:00
Brion Vibber
0b0eed5cba Fix for 'shareddescriptionfollows' message in some non-standard languages (noticed on simple); use wfEmptyMsg() check 2007-03-18 03:44:32 +00:00
Brion Vibber
9150412fe7 For now revert the rev_deleted branch merge; don't want trunk to get too far gone before changes are reviewed!
Reverted: 20511, 20510, 20507, 20474, 20461, 20460, 20457, 20448, 20446
2007-03-16 16:01:07 +00:00
Aaron Schulz
2448539ad9 *Merge in phase3_rev_deleted/includes 2007-03-14 15:50:06 +00:00
Raimond Spekking
a9e30b0b6b * (bug 7782) fix for .svg 2007-03-05 19:53:41 +00:00
Raimond Spekking
c97d076ed1 * (bug 7782) Standardisation of file info at image description pages.
* tweak formatSize/Linker.php for smarter output of big numbers
* RELEASE-NOTES forgotten in r20044
2007-02-27 18:27:11 +00:00
Raimond Spekking
10741f6f13 Suppress external weblink arrow for uploading a new image version 2007-02-09 22:19:54 +00:00
Antoine Musso
a27383b672 Fix #8858 : handle $wgImageLimits changes correctly 2007-02-02 16:22:22 +00:00
Brion Vibber
64e572519f * Fix multipage selector drop-down for DjVu images to work when title
is passed as a query string parameter; we have to pass the title as
  a form parameter or it gets dropped from the form submission URL
2007-01-26 12:10:06 +00:00
Brion Vibber
455e77d168 Fix fix for 8652 (failures with bad XML metadata for DjVu files)
The mid-level functions in Image now fail gracefully on bogus data, as happens when the djvutoxml executable is missing.

Removed the bogus exception check in ImagePage high-level code (which actually just causes a fatal error by calling a nonexistent method :)

Also changed Image::initializeMultiPageXML to do clean lazy loading as Image::load does, and to return true/false as to success/failure for cleaner code using it.
2007-01-26 12:00:04 +00:00
Aryeh Gregor
414fca2323 (bug 8652) Catch exceptions generated by malformed XML in multipage media. Note: not tested, since I don't have all that fancy image-using stuff set up (:P), but it's just a try/catch block, so at worst it just won't work. Better than having the entire page crash due to an unhandled exception . . .
Incidentally, should we maybe use set_exception_handler()?
2007-01-25 03:07:39 +00:00
Nick Jenkins
f88c771756 The war on redundant ampersand usage!
* Convert "$dbw =& wfGetDB( DB_MASTER );" --> "$dbw = wfGetDB( DB_MASTER );"
* convert "$skin =& $wgUser->getSkin();" --> "$skin = $wgUser->getSkin();"

For the time being have not changed the function definitions of wfGetDB() or User::getSkin() [i.e. they are still both return-by-ref], so as to ensure the interface does not change for extensions [some of which may still be trying to run on PHP4 environments]. However presumably at some point this can be changed too.

Also includes tiny tweak to newlines in parserTests - will show 1 rather than 2 newlines between the "Reading tests from" strings when in quiet mode.
2007-01-22 23:50:42 +00:00
Antoine Musso
f5e16ebe09 userCan(Edit|Create|Move) are deprecated : do not use them 2007-01-20 17:58:38 +00:00
Antoine Musso
c771fc9c96 Use Doxygen @addtogroup instead of phpdoc @package && @subpackage 2007-01-20 15:09:52 +00:00
Niklas Laxström
d18b005a6d * plaintext 2007-01-17 18:42:04 +00:00
Ilmari Karonen
81befad1cf Quick fix to make diffonly work properly on category and image pages. Should probably do something cleaner, but this'll do until I can figure out what the cleanest colution is. 2007-01-17 05:01:54 +00:00
Nick Jenkins
784e69d028 For the "includes/" directory:
* removing unused local vars
* removing used global declarations
* adding FIXMEs against extract() calls and lines that seem to be using uninitialized variables
* adding some array() declarations.
2007-01-12 10:03:51 +00:00
Aryeh Gregor
92ed0ffbd6 * (bug 532) Tweaked alt text for some interface messages
* (bug 8231) Gave useful alt text to the main <img> on image pages
* (bug 371) Remove alt text for "Enlarge" icon on thumbnails
2006-12-22 20:31:10 +00:00
Antoine Musso
171945efed User::getOption now accept a default value to override default user values
this makes it consistent with WebRequest::get* methods. Corrected code in
various places accordingly.
2006-12-14 20:28:38 +00:00
Nick Jenkins
5646173bb2 Would probably be wanting "$wgStyleVersion" rather than "wgStyleVersion", otherwise if metadata.js changes can bump $wgStyleVersion till the cows come home, but still won't cause it to be refreshed ;-) 2006-11-23 08:37:52 +00:00
Nick Jenkins
14c53b728f Code housekeeping stuff (and barring any stuff-ups on my behalf, there should be no changes in behaviour whatsoever after this) -
* removing some unused global declarations.
* removing or commenting out or adding comments for unused local vars.
* Adding one or two local var declarations.
* Declaring $matches array passed to preg_match() / preg_match_all() as array() before using [not required, just have a slight preference for the explicitness].
* remove one or two pass-by-reference function declarations where the value is not modified.
* Adding some braces to if-else blocks.
* In Parser.php, stripstrate is now an object rather than an array as per r17820, so we no longer need ask for a reference to it (as in "$x =& $this->mStripState;"), and in fact it's probably just simpler to get rid of $x altogether.
* Moving some preg regexes from "" quoting to '' quoting to stop static analyzer whinging about bad escape sequences.

... up to "LinksUpdate.php" in the includes/ directory.
2006-11-23 08:25:56 +00:00
Aryeh Gregor
2b109a6dc4 (bug 7554) The correct MIME type for SVG images is now displayed on the image page (image/svg+xml, not image/svg). This is a hack because it only affects display, and doesn't correct the internal storage. I don't know how the latter works, so I wasn't confident touching it. 2006-11-22 00:25:57 +00:00
Tim Starling
36ed0cd96c Reverting 17479/17480, breaks subclassing of Linker methods by skins. See my comment on bug 7405. 2006-11-08 07:12:03 +00:00
Nick Jenkins
fa239349f2 * (bug 7405) Make Linker methods static. Patch by Dan Li. 2006-11-08 05:21:15 +00:00
Tim Starling
a3b490d2c4 * Made special page names case-insensitive and localisable. Care has been taken to maintain backwards compatibility.
* Used special page subpages in a few more places, instead of query parameters
2006-10-30 06:25:31 +00:00
Brion Vibber
3af8ce82b9 * Added global $wgStyleVersion to centralize bumping CSS and JS file versions
for cache-friendly style and script updating
2006-10-13 21:48:19 +00:00
Tim Starling
3005679b0e * Removed lots of explicit require_once statements. The autoloader should theoretically be faster, because it always uses an absolute path, eliminating the need for a search, and it is never called unnecessarily. Absolute paths are also more robust in the face of odd configurations or usage patterns. Moved a few constants around to support this, they always have to be available before the method call.
* Deleted DatabaseMysql.php, no longer necessary, database classes are autoloaded. 
* Moved wfGetMimeMagic() to MimeMagic::singleton()
* Fixed a couple of __CLASS__.'::'.__FUNCTION__ things.
2006-10-03 13:00:52 +00:00
Jens Frank
78ab955e98 add missing wgLang definition 2006-09-13 20:43:04 +00:00
Brion Vibber
ce7a9631d7 * Set default disabled values for DjVu render options
* Added Xml::option() for generating <option>s easily
* Localized page numbers in drop-down for DjVu page selection
* Fixed linktrail for vi
2006-09-06 08:53:02 +00:00
Jens Frank
7f7e79022b (bug 6420) Render thumbnails for djvu images, show multipage preview on image page 2006-08-13 17:34:48 +00:00
Rotem Liss
241676caf2 Removing the last references to OutputPage::sysopRequired() and OutputPage::developerRequired() (mostly using OutputPage::permissionRequired(), but in one case - reverting of a protected image - OutputPage::readOnlyPage is better), and throwing an exception when calling them; removing two useless comments. 2006-08-08 13:58:25 +00:00
Antoine Musso
61967dadc4 Code quality: makes imagePage::doDelete compatible with article::doDelete 2006-07-11 19:58:08 +00:00
Antoine Musso
93154120cc Remove forced dereferencements (new() returns a reference in PHP5) 2006-07-11 14:11:23 +00:00
Rotem Liss
88cbeb2d4b Direction mark between the image file name and its size in the image page, to prevent confusion. 2006-07-05 19:43:06 +00:00