Commit graph

42 commits

Author SHA1 Message Date
Aaron Schulz
e369f66d00 Replace wfRunHooks calls with direct Hooks::run calls
* This avoids the overhead of an extra function call

Change-Id: I8ee996f237fd111873ab51965bded3d91e61e4dd
2014-12-10 12:26:59 -08:00
Chad Horohoe
f7ada91b09 RawAction: private variable removing m prefix + doc better
Change-Id: I526ebcbb1429af42fa9e33cdf59d12c4854247f7
2014-09-12 11:39:36 -07:00
Kunal Mehta
f6b5b8c899 includes/actions/: Use Config instead of globals
Changed InfoAction::pageCounts to be non-static, so
it's able to access $this to get the Config object.

Also replaced instances of $wgScript with wfScript().

Change-Id: I4a6a3224e762f13640af04a73e2934b887dffedd
2014-08-13 20:34:32 +00:00
withoutaname
db635855f2 Shorten ternary expressions in RawAction.php
Change-Id: Idc9e74344989bf1394e05ebaf23cfd9a8fb38e1a
2014-07-23 12:02:37 -07:00
withoutaname
3702d19788 Remove deprecated RawPage class
Change-Id: I7a75a09de934250604317983a4446ecaa9fa6550
2014-07-20 22:58:44 -07:00
withoutaname
071353c89a Remove deprecated HistoryPage class
Change-Id: I3db4d5a1a2c574a73e2fcfe1fd1da49f3570e4b6
2014-07-21 04:54:40 +00:00
Bartosz Dziewoński
59002d8935 Consistently use '@deprecated since <version>'
Variants included 'in <version>', 'as of <version>' and just the
version number.

Some @deprecated annotations do not have the version number at all,
I want to hunt them down separately.

Change-Id: I8208c6097098f4735d4f51bc42254675f1f27f6d
2014-04-15 22:18:19 +02:00
umherirrender
829886b10a Fixed some @params documentation
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.

Change-Id: I64e8cfe478cb0ba438f40b0631d6e9049cdab567
2014-04-14 12:59:19 +00:00
Siebrand Mazeland
f077c4b1d6 Update formatting
Change-Id: I18aff576262479c9bb1c56eb8e1d1aaae200e4b1
2014-02-06 09:27:05 +01:00
Brian Wolff
6e2be46e82 Send cache purges for action=raw after editing user css/js
These types of requests can be cached for a short time (~5 min) in
Squid/Varnish.

Change importScript to be consistent with importStylesheet in the query
parameter order (title, action, ctype).

We only send purges for the exact urls as used by importScript and
importStylesheet.

Note: ResourceLoader things have their cache handled separately and
aren't affected by this change.

Users like instant updating of scripts after having changed them.

Bug: 56874
Change-Id: Idaa8552cf371dbafeb8b730f35b3b5c4fc339fb0
2014-01-03 18:43:23 +00:00
csteipp
636c64482d SECURITY: Don't cache when a call could autocreate
Fixes for action=raw (used when sites include other site's javascript),
and stashed images.

Bug: 53032
Change-Id: I8f915f6a4756f750c74d9ee9bec58f7ba6c0c827
2013-11-14 14:36:24 -08:00
Siebrand Mazeland
cb8a9bb78a Break long lines in Action classes
Fixes CodeSniffer errors and warnigs.

Change-Id: Ic9cf4b9c677b3168d7c9820e2694080907997ee3
2013-11-14 18:18:49 +00:00
Siebrand Mazeland
6ea188fee5 Update formatting
Change-Id: I3cbe1f5e48730fbbe57e4b20a0c202edddc93c95
2013-11-14 12:20:43 +01:00
Brad Jorsch
cdd46ac98e Followup Idfee1b4d per Tim
OAuth was going to return different values for UserIsEveryoneAllowed
depending on whether OAuth headers were provided, so the bolding on
Special:SpecialPages wouldn't be odd. That wasn't liked, so instead
we'll only mark special pages as restricted based on $wgGroupPermissions
and not what extensions might do.

Also, it was suggested that if an extension can remove 'read' then the
cache headers set by RawAction and the API should reflect that.

Change-Id: I381553e79c5320083c6d6d9ddd5bc0b146600f9e
2013-07-26 11:03:11 -04:00
Timo Tijhof
1f956360b8 Deprecate $wgJsMimeType
It hasn't been used for its documented purpose for a while.
In fact the one significant thing it can cause wasn't even
documented. If set to anything other than "text/javascript"
it will cause action=raw to no longer respond to
ctype=text/javascript requests (such as done by wikibits'
importScript function).

Follows-up 97caae596d.

Change-Id: Ib04ff5b21eb0ae172b94e31bc0dc16c9649e1864
2013-05-21 01:17:44 +02:00
umherirrender
1bfc8feb25 Fixed spacing in actions/cache/filebackend/filerepo/job folder
Added spaces before if, foreach
Added some braces for one line statements

Change-Id: Idb93d34e314e5f314223b79208968d6bcd30c40e
2013-04-20 19:18:13 +02:00
Siebrand Mazeland
338ba4cb0b Add docs for constructor
Change-Id: I976dc8fc8a3736aaa7964cedb8e9470eacf5fda0
2013-04-01 18:54:07 +02:00
Alexandre Emsenhuber
f4b1735753 Fix case of some Title methods (final round)
Change-Id: I41afed9c1d19aaca62685a51f881cf04a10998d8
2013-03-28 11:30:06 +01:00
Alexandre Emsenhuber
a09a89b48e Documentation improvements in includes/actions
- Separate file and class documentation
- Add some missing class documentation
- Fix erroneous documentation

Change-Id: I35c846ad63e837165b79456dc89d330498aebf64
2013-03-05 16:39:35 +01:00
umherirrender
f3cf109e62 remove space before semicolon
Change-Id: Ic0d890f5e27cec017c7f7910a67d53b2edf82079
2013-02-09 22:44:24 +01:00
daniel
acedeeb360 [Bug 41128] Handle null content in action=raw.
In RawAction, there are several cases in which we have null instead
of a Content object. Most importanty, this applied for deleted revisions
and missing sections. Handle these cases gracefully.

Change-Id: Iac8560755718a46dcc4dcf118322a66d1caefdae
2012-10-18 12:58:25 +02:00
daniel
0d78e4aedb [Bug 40032] code 415 for bad type in action=raw
Non-text content is not supported via action=raw. Use code 415 instead
of 406 to indicate this.

Change-Id: I6b7fbc5f4d0040ca2c90b77b2ceb39853f136fd8
2012-10-14 23:35:52 +00:00
daniel
329d5b3516 Merge branch 'Wikidata' into master.
This introduces the ContentHandler facility into MediaWiki,
see docs/contenthandler.txt.

For convenient review, a squashed version is available at
https://gerrit.wikimedia.org/r/27191

The ContentHandler facility is a major building block of the Wikidata project.
It has been discussed repeatedly on wikitech-l.

Change-Id: I3804e2d5f6f59e6a39db80744bdf61bfe8c14f98
2012-10-09 11:34:24 +02:00
umherirrender
22dd67ea3c Avoid direct access to $wgGroupPermissions
Created a new method User::groupHasPermission and check also
$wgRevokePermissions for the given right

Change-Id: I41edb091fa35c8c68b6f95cc5fd208ea99418cdb
2012-10-09 06:41:23 +00:00
daniel
a9ab712c4c fix typo in error message
Change-Id: Idb2e799e383a51dbad1a5b57f37b6bf24d142b4d
2012-06-20 19:14:08 +02:00
jeroendedauw
a7e28d2011 merged master
Change-Id: I4cf7b0f87cd571a6b50f66995dd9ad987a6ecdf8
2012-06-06 16:44:15 +02:00
awjrichards
c29fd59775 Big oops - merged to wrong branch.
Revert "Revert to arbitrarily old point before initial remote branch creation to help clean up"

This reverts commit ee0d3d330f
2012-06-05 22:58:54 +00:00
awjrichards
ee0d3d330f Revert to arbitrarily old point before initial remote branch creation to help clean up
Change-Id: I41a3d1e55d3ea9dffa42451237fe065f9334361d
2012-06-02 08:43:04 -07:00
Alexandre Emsenhuber
2c7bf8b8b8 Added missing GPLv2 headers in some places.
Also made file/class documentation more consistent.

Change-Id: Ie95c594fcd686ef30dadc7574d3e5b47236a8638
2012-06-03 22:54:44 +02:00
daniel
cbc2014b2d Use integers for content_model and content_format.
Representing content_model and content_format as integers in the
database was suggested by Asher mainly to save space.

This change entails some refactoring and renaming, but no big
change in logic.
2012-05-14 10:22:52 +02:00
Jens Ohlig
10e91851b2 Merge branch 'master' into Wikidata
Conflicts:
	.gitreview
	includes/Article.php
	includes/AutoLoader.php
	includes/EditPage.php
	includes/LinksUpdate.php
	includes/WikiPage.php
	includes/installer/Ibm_db2Updater.php
	includes/installer/MysqlUpdater.php
	includes/installer/OracleUpdater.php
	includes/installer/SqliteUpdater.php
	maintenance/refreshLinks.php
2012-04-11 14:24:29 +02:00
Daniel Kinzler
79f79a356c trigger http error when non-text content is requested using action=raw 2012-04-04 20:00:31 +02:00
Alexandre Emsenhuber
d1abcf7e92 Changed wfMessage() usage to call directly MessageCache::get() so that its $isFullKey parameter can be set to true.
The $isFullKey parameter means the message key already contains the language subpage ("/de", etc.)

Change-Id: Iceb1243ae6af126e2abbabbb05441a8602c17ef6
2012-03-30 18:00:21 +02:00
Alexandre Emsenhuber
c025d708eb Use WikiPage instead of Title to get its id, whether it exists and its latest revision's id 2012-02-02 09:55:04 +00:00
Gabriel Wicke
a521795ebb Support If-modified-since for RawPage, fixes bug #10023.
The check to WikiPage::getTouched will load the latest revision data, which is
not ideal for performance. In a quick test using ab -c 100 -n 1000 and without
MemCached enabled, the request rate for plain GET requests drops slightly from
108 to 104 req/second. As described in my comment
https://bugzilla.wikimedia.org/show_bug.cgi?id=10023#c9, this could certainly be
improved on. Overall, a few unmodified responses should still make the
server-side performance impact of this patch positive, while improving
client-side performance considerably for unmodified content.
2012-01-10 18:16:38 +00:00
Aaron Schulz
e6f780d48d Reverted r101014 per CR. Added comment. The sooner RL2 kills this the better... 2011-12-20 00:57:25 +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
Chad Horohoe
394a5ba7a7 Reduce some duplication in Action::getRestriction(), all but 2 (plus one extension) return null anyway 2011-12-06 17:40:12 +00:00
Alexandre Emsenhuber
f2d0453f9d * Made PermissionsError exception accept an optional second parameter for the description of the errors (as returned by Title::getUserPermissionsErrors())
* PermissionsError now calls OutputPage::showPermissionsErrorPage() to display the error (this is needed to make the item above work correctly)
* Removed the override of the HTML title in OutputPage::showPermissionsErrorPage() so that it shows "Permission errors - Sitename" instead of simply "Permission errors" for consistency with the other things
* Pass the error array returned by Title::getUserPermissionsErrors() to PermissionsError where available
* Converted direct calls to OutputPage::showPermissionsErrorPage() to throw an PermissionsError error instead
* Added 'action-rollback' message that will be displayed when accessing action=rollback without sufficient rights
* Changed getRestriction() in subclasses of Action to return null when they previously returned 'read' so that user rights can be check with Title::getUserPermissionsErrors()
* Reordered checks to do first user rights, then block (if needed) and finally read only (also if needed) so that users don't think the error is temporary when they both don't have right and the database is locked
2011-11-02 15:30:55 +00:00
Aaron Schulz
c35bbedc83 * Pass in $user to Revision::getText()
* Minor style cleanups
2011-10-27 18:24:49 +00:00
Alexandre Emsenhuber
2a5c29ace7 Fix for r100333: forgot to override requiresWrite() and requiresUnblock() 2011-10-20 10:29:51 +00:00
Alexandre Emsenhuber
e1280017e0 * Changed action=raw to use an Action subclass
* Left RawPage with back compat code for extensions that use it
* Removed calls to Skin for gen=(css|js). Calling action=raw&gen=(css|js) will now unconditionally return empty content
* Removed Skin::generateUserJs() and Skin::generateUserStylesheet() since they were only used in RawPage
2011-10-20 08:10:25 +00:00