Commit graph

95 commits

Author SHA1 Message Date
Daniel Friesen
39ab3cfc9f Implement Message::isBlank and Message::isDisabled.
And while we're at it... update a random assortment of code using wfEmptyMsg to use the new wfMessage class and our exists/isBlank/isDisabled methods.
2011-01-14 10:51:05 +00:00
Roan Kattouw
0d544e5f7f Per r72349 CR, bring gen=js behavior back, at least for now. It'd be nasty to serve weird stuff to people still hitting gen=js with old code. 2010-10-23 15:42:19 +00:00
Jack Phoenix
2fa78fc083 coding style tweaks 2010-10-20 12:00:55 +00:00
Roan Kattouw
32377424b9 Merging resourceloader branch into trunk. Full documentation is at http://www.mediawiki.org/wiki/ResourceLoader and a general overview has been posted on wikitech-li <http://lists.wikimedia.org/pipermail/wikitech-l/2010-September/049253.html>. One important change is that all JS is now loaded at the bottom, so any scripts assuming things from wikibits or whatever are present will fail. 2010-09-04 04:00:09 +00:00
Alexandre Emsenhuber
0f46b8da6a Removed PHP4-ism 2010-08-08 14:58:29 +00:00
Alexandre Emsenhuber
5be509b0c1 * Standardised file description headers
* Added some descriptions
* Added @file where needed
2010-08-08 14:23:14 +00:00
Sam Reed
04f68827d0 Removal of unused globals
Removal of one setting of a variable to '', then not using further
2010-07-24 19:11:52 +00:00
Alexandre Emsenhuber
c8c6b757e5 PageHistory class renamed to HistoryPage 2009-12-18 21:44:41 +00:00
Domas Mituzas
74b880f13f I LOVE OO PEOPLE <3 <3 <3 2009-08-27 16:28:48 +00:00
Tim Starling
07efbeb8ae * Fixed XSS vulnerability introduced by r49833. Only pre-release versions of MediaWiki were affected.
* Refactored the IE script entry point security check into WebRequest::isPathInfoBad(). Use the standard CGI variable PATH_INFO to do this check instead of the various potential non-standard solutions. Made the check fairly permissive to avoid a repeat of bug 13049 due to broken CGI setups especially with cgi.fix_pathinfo=0. This should theoretically be very portable and secure, but I have not tested it widely.
* Removed Chris Wrinn from the credits since his patch was wrong and has been removed.
* Made the error message more informative.
2009-08-17 13:23:45 +00:00
Michael Dale
2d5154e634 * addressed r53282#c3209 moved conditional inclusion of $wgExtensionMessages in mwScriptLoader.php to Setup.php
* put a @ in front of get_headers() should hopefully avoid errors where allow_url_fopen=0
* combined $wgPhpCliPath into the similar used $wgPhpCli var
* minor js & example file mwEmbed fixes
2009-07-15 22:41:56 +00:00
Bryan Tong Minh
39d3ce07cc Add the 403 fix from r49833 to RawPage as well. 2009-07-13 21:39:57 +00:00
Aryeh Gregor
bed65d358b More helpful error message if PHP_SELF isn't set
Raw page access was failing in some server configurations with CGI (or
in my case, FastCGI).  This gives a nicer and more correct error
message.  Possibly better solutions:

1) Figure out how to do this without PHP_SELF.

2) Give a warning or error on installation, or even on every page view,
since this will break all raw page viewing.

I ran into this when doing a file copy of my wiki install to another
site, FWIW.  Even with the new error message, I'd have had to look at
the CSS files to figure out what the problem was (the user-visible
symptom was that custom styles didn't work).
2009-01-25 01:31:48 +00:00
Alex Z
6779a2cc13 adding newline to end of wfDebug calls where it was missing. 2009-01-13 20:28:54 +00:00
Aaron Schulz
ef0a444264 (bug 11330) Improper use of WebRequest::getIntOrNull() 2009-01-02 11:07:12 +00:00
Brion Vibber
df408a59ad Revert r45160 "(bug 11330) Passing default to Request->getInt() is good enough, rather than added code to do the same thing"
This rev changes the behavior, forcing $smaxage to $wgSquidMaxage in cases where we would have previously ended up with $wgForcedRawSMaxage or 0.
2008-12-31 21:05:21 +00:00
Aaron Schulz
147e58f804 (bug 11330) Passing default to Request->getInt() is good enough, rather than added code to do the same thing 2008-12-29 18:58:27 +00:00
Aaron Schulz
0dd5d00e67 FileCache tweaks:
* Fix typo self -> MediaWiki
* View updates run on client cache hits
* Removed unneeded $wgOut->disable() call
* Disabled unused output on rawpage cache hits
* Removed redundant checkLastModified()
2008-12-28 15:03:57 +00:00
Aaron Schulz
f0a60c4fef FileCache cleanuo:
* Add a clearFileCache() function in the place of various unlink() calls. This also clears the raw page cache.
* Fix useFileCache() for loop
* Add mType field to file cache objects
2008-12-28 14:19:39 +00:00
Aaron Schulz
a339ab8ee1 Enable filecache for raw page hits if $wgUseFileCache is on 2008-12-28 13:32:32 +00:00
Aaron Schulz
d3e278c4f0 Minor RawPage tweaks 2008-12-10 04:54:46 +00:00
Alexandre Emsenhuber
177b1e264a Tweaks for skins:
* Moved SkinTemplate::addStyle() and related stuff to OutputPage so that it can be used non-SkinTemplate skins and avoid duplication with the actual OutputPage::addStyle() (the two functions have the same format).
* Non-SkinTemplate skins now also load their CSS with <link> tags instead of @import.
* Moved SkinTemplate::setupUserCss() to Skin.
* Merged action=raw&gen=(js|css) for SkinTemplate and non-SkinTemplate skins, renamed functions to Skin::generateUserJs() and Skin::generateUserStyleSheet() and dropped a lot of cascading call which is a bit incomprehensible.
2008-08-21 14:09:57 +00:00
Alexandre Emsenhuber
087a9f70c5 WARNING: HUGE COMMIT
Doxygen documentation update:
* Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group.
* Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file.
* Removed some empty comments
* Removed some ?>

Added following groups:
* ExternalStorage
* JobQueue
* MaintenanceLanguage

One more thing: there are still a lot of warnings when generating the doc.
2008-05-20 17:13:28 +00:00
Siebrand Mazeland
79d5225c0e * remove end of line whitespace
* remove empty lines at end of file
* remove "?>" where still present
2008-04-14 07:45:50 +00:00
Brion Vibber
bacf4234d4 * (bug 12938) Fix template expansion and 404 returns for action=raw with section
Function returned early, so further processing didn't happen in the section case.
2008-02-13 02:36:28 +00:00
Brion Vibber
da6377abb1 Restore the complete prohibition on action=raw with arbitrary script entry points.
While only MSIE is known to let the URL's "extension" override the allowed mime types, other browsers will still happily download a file with the name from the URL. That seems unwise as the content may be arbitrary (and perhaps executable).
2008-01-19 01:18:23 +00:00
Brion Vibber
669a6b4bab * (bug 12505) Fixed section=0 with action=raw
PHP's fuzzy type comparisons strike again! A check for $this->mSection != '', probably intended to protect against an unset value, matched for integer values of 0 as well. (The fun part is that 0=='' and 0=='0' but '0'!='' :) Since the parameter is validated through getIntOrNull(), only the null check is necessary here.
2008-01-09 02:18:58 +00:00
Domas Mituzas
9d70db7d8c Cache by default raw views for CSS & JS files for all users, controllable by $wgForcedRawSMaxage 2007-11-13 13:24:51 +00:00
Daniel Cannon
393ce6d8df (bug 11353) Add ability to retrieve raw section content via 'action=raw' by specifying a 'section' parameter in the URL. 2007-09-26 05:23:03 +00:00
Brion Vibber
d740bd3bb6 Revert r24105, r24106, r24107 'security fix' forbidden text/css and text/javascript for pages not matching some particular formats.
This doesn't actually do the job; browsers aren't this picky about their JavaScript, and many aren't picky about CSS either. Further, this actually breaks internal JS such as the gen=js mode.
2007-07-17 15:50:50 +00:00
Rob Church
d4b6572b83 MIME is an acronym... 2007-07-15 05:08:06 +00:00
Daniel Cannon
3d94b0e49b Actually, let's make that message a tid bit more clear: "Page type not compatible with requested mime type." 2007-07-15 05:04:24 +00:00
Daniel Cannon
2d92044bb7 Security fix: Previously it was possible to include unprotected and even content pages in site and user jss/css pages via action=raw. Now when requesting a page as text/javascript or text/css, if it should not contain such content, it simply returns '/* EMPTY */'. 2007-07-15 04:57:45 +00:00
Aryeh Gregor
a15c419b3d Remove ?>'s from files. They're pointless, and just asking for people to mess with the files and add trailing whitespace. (Yes, I looked over every one and reverted those that were bogus. Slash-enter a million times in less worked well enough, although it was a bit mind-numbing.) 2007-06-29 01:19:14 +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
Brion Vibber
1ef7033d4c * (bug 9044) Send a comment with action=raw pages in CSS/JS output mode
to work around IE/Mac bug where empty pages time out verrrrryyyyy slowly,
  particularly with new keepalive-friendly HTTP on Wikipedia
2007-02-21 09:39:33 +00:00
Brion Vibber
6038f9ed00 * Clean up session checks to better handle the case where the session was
opened during the current request. May help with some caching corner
  cases.
2007-02-05 21:42:48 +00:00
Antoine Musso
c771fc9c96 Use Doxygen @addtogroup instead of phpdoc @package && @subpackage 2007-01-20 15:09:52 +00:00
Antoine Musso
b144fcb85d Rename constructors to __constructor 2007-01-20 13:34:31 +00:00
Leon Weber
05b3050d1e * (bug 8567) Added hook RawPageViewBeforeOutput just before the text is blown out in action=raw,
so extensions might influence the output.
2007-01-11 14:50:34 +00:00
Brion Vibber
373393b0f0 * Fix regression in cachability of generated CSS and JS for MonoBook skin,
while avoiding clobbering of different users' cached data

Added a "Vary: Accept-Encoding, Cookie" a few weeks ago on generated CSS/JS
files to prevent different users' styles from clobbering each other in
caches. Unfortunately browsers don't seem to handle Vary well, and this
caused a lot of extra hits due to poor caching.

This is now removed, replaced with an explicit "Cache-Control: private"
or "Cache-Control: public" depending on the presence of an open session
cookie or logged-in state. This should restore the friendly caching
behavior while ensuring that no users' generated data will clobber
anyone else's.

To additionally ensure that public cached CSS doesn't clobber the
private bits, smaxage=0 is set on the URL used for logged-in views,
as already done for JS.
2006-09-26 05:30:12 +00:00
Brion Vibber
42f36d6011 * Set Vary: Cookie on action=raw generated CSS and JS, to ensure that user
preferences don't get stuck in proxy caches for other people

Man this one's embarassing, we should have fixed it ages ago.
This should I think fix the longtime problem where people sometimes
see things like underlining of links change spontaneously.
2006-09-13 19:30:12 +00:00
Brion Vibber
2997fd7637 * (bug 7064) Replace hard-coded empty message checks with wfEmptyMsg calls 2006-09-11 12:22:35 +00:00
Brion Vibber
47d11d092d * (bug 7026) Fix action=raw&templates=expand
http://bugzilla.wikimedia.org/attachment.cgi?id=2229&action=view
2006-08-31 16:48:37 +00:00
Tim Starling
4657da77f4 Only use the message cache in action=raw if it is explicitly requested. The previous behaviour was counterintuitive unless you're pulling stylesheets or javascript into HTML. It's been the source of many complaints from people trying to use action=raw as an API. 2006-08-29 07:36:02 +00:00
Lupin
b28f82ca6d (bug 6771) Make old revisions of MediaWiki pages available with action=raw 2006-07-28 03:12:54 +00:00
Rob Church
958aa1aef8 * (bug 5903) When requesting the raw source of a non-existent message page, return blank content (as opposed to the message key)
* Improve default blank content of MediaWiki:Common.css and MediaWiki:Monobook.css
2006-06-24 21:17:05 +00:00
Domas Mituzas
e6085d6e36 AutoLoad Revision 2006-06-06 10:56:46 +00:00
Brion Vibber
0a26267688 Revert to r14512; domas introduced massive breakage with incomplete experimental changes. They will be recommitted when they work. :) 2006-06-01 08:19:02 +00:00
Domas Mituzas
bda0b8e104 Use AutoLoader to load classes:
* remove require_once() throughout whole code, yet left in few places
* move global functions in HttpUtils, ProxyTools, Credits to class methods
* php5 only: __autoload() now used, combined with class->file map and require()
* move initialization of $wgValidSkinNames to Skin::getSkinNames()
* few more changes that will surely break stuff.
2006-06-01 07:22:49 +00:00