This avoids muliple cache calls to explicitly defined tags by
calling the showTagEditUI of ChangeTags only once in logs and
histories.
Change-Id: I2e36dbd96d3fcca06de0bf418bc6dc294d8d18d3
* Convert existing use of WebResponse::header() for HTTP status headers
to use this new statusHeader() method.
* Extend unit test forFauxResponse.
I'm not calling HttpStatus::header directly in code. We keep the abstraction
layer of WebResponse so that responses can continue to be mocked/fauxed without
affecting the outer HTTP response.
Change-Id: I8a536e16659fa88b54cffa1457efb889efa5fcd6
Method similar to SpecialPage::outputHeader() to avoid registering
tons of system messages and to have -summary and -helppage tidily
listed together in Special:AllMessages by default.
Bug: T45591
Change-Id: Ic849dde00be7379c1909a8486cf20f48c5aea5cf
The number of pages was always the total count of all members of that
category, not just pages. Correct that and also show the total count.
Change-Id: I246d92b35d508e10fd93f9c7209db11a6e0eeb7a
The intention of the new hook is to allow extensions to prefetch
any information that may be needed for displaying history rows.
In particular, this is needed by Wikibase to allow us to inject
localized entity labels into the edit summaries.
Bug: T95672
Change-Id: Ie10ef99154da35713a4f583e2de2162fba28eef2
There is a new special page, Special:EditTags, which is very similar to
Special:RevisionDelete in a lot of ways. In fact, the SpecialEditTags class
started off as a copy-paste of SpecialRevisiondelete.
You invoke this special page by going to an article history page, checking
some revisions, and clicking "Edit tags of selected revisions". Then you
pick the modifications you want to make and click "Apply". Very much like
the revision deletion workflow.
I had to restructure some of the Action routing code, which was only
designed to handle revision deletion. Also removing some code from
SpecialRevisiondelete which didn't work as advertised in the first place,
and definitely doesn't work now.
Change-Id: I7d3ef927b5686f6211bc5817776286ead19d916b
All the chosen targets are translatable public domain help pages
on MediaWiki.org. Mostly special pages and actions for privileged
users for now.
Adapted from the Translate extension, credit to Niklas Laxström
(TranslateUtils::addSpecialHelpLink).
Depends on 6f5b29ff4e, whose commit
message has a typo addIndicator() instead of setIndicator().
Bug: T45591
Change-Id: I2934b1708a0d207dcf3d940264f140613646f203
This change will not break the usage of the messages, because there are
usually used escaped in mediawiki/core.
Change-Id: I049134e2fbfadab04ac228090d17fd18c5baca3d
Xhprof generates this data now. Custom profiling of various
sub-function units are kept.
Calls to profiler represented about 3% of page execution
time on Special:BlankPage (1.5% in/out); after this change
it's down to about 0.98% of page execution time.
Change-Id: Id9a1dc9d8f80bbd52e42226b724a1e1213d07af7
Special:WhatLinksHere gets now passed hideimages=1
if the concerned page is in the File namespace.
A bit of history:
the 'hideimages' parameter has been added to Special:WhatLinksHere
with commit 06ad0d25 (r34267), then removed with commit cdc7e22d
(r34277), and finally added back with 725cb284 (r34320).
Change-Id: I0f358e52c38bb525cee8085ca206118ee276889d
RevertAction::getDescription cannot set subtitle on OutputPage,
because the subtitle on OutputPage gets cleared before the
result of getDescription is added and than the subtitle is gone.
Refactored the code for building the backlink into a static function
and use it.
Change-Id: Iedad0b8e040035a9a10a0b140d2322357e6b539a
Replaced by an array() and removed an unused variable near by.
Follow-Up: I61bb3c358f755ed9f2153d94b744c1a9da02c456
Change-Id: I5c4dc22e1e9346bfc410a9dda4353d5297a5825e
Stop littering MediaWiki with globals, provide a common
api for generating them similar to how we do text input
attributes before things get out of control.
Adds
* submitButton
* linkButton
Change-Id: I61bb3c358f755ed9f2153d94b744c1a9da02c456
This provides better mobile experiences on various pages
and a more consistent UI across both mobile and desktop.
It does this in two ways.
1) Forces HTMLForms to not use table based layouts so as
not to interfere with responsive nature of mediawiki ui elements
2) Applies MediaWiki.UI classes to most pages
If a page is created via Xml or Html classes it will use mediawiki ui
Where possible I've added classes unconditionally, but for cases of buttons
this is behind the $wgUseMediaWikiUIEverywhere global since button styling is
enabled on pages by default and for checkboxes since it is changes HTML markup.
3) Adds all MediaWiki.UI styles to pages which can use it
When enabled:
* Apply these styles to all pages which use HTMLForms
* Apply to EditPage
* Apply to anything that uses certain elements outputted by the
Xml or HTML helper classes
* Apply to History page
* Apply to protection page
* Apply to move page
* Apply to deletion page
Currently kept behind a global to allow us time to finetune
existing elements. After further testing we will look to kill the
globals and make mediawiki.ui the default
See: I430c0fbb79d2a33bb828b2427bda0ee01115d73f
Change-Id: I47db5eab4569514d039261d11b6dedb0eeae17b5
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
No need to return true on success, because failure gives Exception,
so the return value needs no checking.
Change-Id: Id59bfaebc14bd1c638a721c303f585c1de627508
For pages like Special:Watchlist that throw
a UserNotLoggedIn exception when the user is
anonymous, this patch makes the page redirect
to the login page automatically.
This is instead
of the current behavior of showing a link to
the login page that the user must click.
(Also, Special:Userlogin has existing functionality
that will redirect the user back once they are
logged in.)
Bug: 15484
Change-Id: Idd9325374cb5dc13c4c057f45f88a33bdff523a9
This change adds a preference in the 'watchlist' section to
automatically watchlist a page after rollbacking.
The setting is only visible, if the user has the 'rollback'-right.
I have removed the watch reverts function per advice by Vogone.
Bug: 4488
Change-Id: I3aa831c9c04d627684641af0ca5a332795c87062
- Swap "$variable type" to "type $variable"
- Added missing types
- Fixed spacing inside docs
- Makes beginning of @param/@return/@var/@throws in capital
- Changed some types to match the more common spelling
Change-Id: I7b65fe04db431342cc58b469dc48f41a50c4e891
RevertAction was simply a dummy class for outputting an error message
if the action was not done in the file namespace. I've instead
moved RevertFileAction to RevertAction and threw an exception
from within checkCanExecute().
Change-Id: I7b87de60680009bf4e74d33342cbe81cc0d211b5
Title::getDBkey() only returns the page name without the namespace
which means that "Test" and "User:Test" (for example) pages would
have the same token; use Title::getPrefixedDBkey() instead to
avoid this.
Change-Id: I80333b23cec0cfe6546f6e7776b0a77b56ee20c8
- Describe the possible types of $next parameter in the documentation
rather than inline along with the possible values
- Split the big if ... elseif block into separate blocks. The elseif
are not needed since each path returns
- Only create the revision object when really necessary
Change-Id: Ic92a6f6bd405d3f820d562a7322d34e3d9d33d17
Special page PageLanguage to set the page language of a page.
To enable the feature, set $wgPageLanguageUseDB to true
and assign the 'pagelang' user right to a user group.
Bug: 35489
Change-Id: I0f82b146fbe948f917c1c5d29f7469644d797e80
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
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
Also removed true as second parameter to it from CloneDatabase.php
since it is the default value of that parameter.
Change-Id: I727ebae2bd4df0e26019985ce8c7ce73381c5642
When $wgNamespaceRobotPolicies contains a noindex for a namespace and
the page contains __INDEX__, the index status on action=info was
"Disallowed", but that is wrong, because the page is indexed.
Pass the 'index' to the robot policy logic.
Change-Id: Ib77c3e73968cdc72f657e50371a2372564a1c618
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
This function calls $page->getUserText() and $page->getTimestamp(). These
functions are not specified in the interface Page (which actually specifies
nothing at all). Page is only implemented by WikiPage and Article. Article
does not implement getUserText() and getTimestamp(). WikiPage does.
CreditsAction::getAuthor() cannot ever be given an Article, because that
would cause a fatal error "call to undefined method".
Change-Id: I0ba29622b7307845345ce645cb63b53614aaf2ab
Callers should use SpecialPage::getPageTitle, which is
exactly identical.
This is so that in the future we can turn SpecialPage
into a ContextSource, which requires getTitle to return
getContext()->getTitle.
Change-Id: Icdcf5d5295ef5e7f08b1d403e0c123f78738fd40
Fixes for action=raw (used when sites include other site's javascript),
and stashed images.
Bug: 53032
Change-Id: I8f915f6a4756f750c74d9ee9bec58f7ba6c0c827
This patch adds a new table row with the content model of the page, this
is usally wikitext, can also be javascript or CSS.
Bug: 56033
Change-Id: If91f6c20d79cd7b3b8924ab6c3df5f90acd8c7a1
Also removed some unnecessary ones. I think I've caught them all.
The spaceless version already appears in core ~300 times (after
accounting for false positives when grepping). Some consistency would
be nice.
Change-Id: I607655b5f4366e66dc78730d5fd2f57ed8776cae
* Follows-up b2e2b2e016.
* Minor clean up of surrounding documentation comments.
* Fixed missing keys for messages in WebInstallerPage
Change-Id: Iaa692064262f3c0e10cfa5e4b1ec8c86e5d02362
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
Added a MWTimestamp::format method to format a timestamp object in the
given pattern. This avoids date(), which needs the local time
zone corretly set on the server, which is assumed at the moment in
Setup.php
Added MWTimestamp::getInstance for gmdate() and
MWTimestamp::getLocalInstance for date() to create a MWTimestamp object
and use it as inline statement.
Also MWTimestamp::setTimezone and MWTimestamp::getTimzone was added for
timezone handling.
Change-Id: I812aa013be2f4380e0cf10dc465202756fe8347b
The previous behavior enforced a minimal maximum of 10, even if
$wgFeedLimit was set to a lower value.
Also grepped everything for $wgFeedLimit and fixed all other
error-prone (but correct) uses.
Bug: 50886
Change-Id: Ia81bbadfcf4270b0f932b543265ca37f364530f3
These are needed for OAuth grants.
Note that, even if 'editmywatchlist' is not granted, various actions
will still allow for adding but not removing of pages.
Change-Id: Ie33446a228dd6ed0114730935c1bf65667f5ce01
Currently, WatchAction::doWatch and WatchAction::doUnwatch return true
always. Let's have them return a status object instead.
This also cleans up the handling of Status objects in some of the API
modules.
Change-Id: I9dd9f0fd499c37f29fa12bcdb6142238a1f11e4d
To avoid PHP notices, add a cache version key to
the page count cache so that it is invalidated
when the InfoAction cache format is changed.
Bug: 43766
Change-Id: I7fe4da351506d8b98490e9fbbeb51c2c081fc2a8
Removed actions that should not be in Title::invalidateCache,
specifically the clearing of the InfoAction cache, and added
those actions to their appropriate locations.
Added a new method InfoAction::invalidateCache that clears the
cache for a given title.
Bug: 46816
Change-Id: Ic12c66446c0d71f567dceb5d4630382ff41ad8bf
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
Removed actions that should not be in Title::invalidateCache,
specifically the clearing of the InfoAction cache, and added
those actions to their appropriate locations.
Added a new method InfoAction::invalidateCache that clears the
cache for a given title.
Bug: 46816
Change-Id: I38ac616d2e99fb339aca33425745368ba85b6350
And added/removed spaces around some other tokens,
like +, -, *, /, <, >, =, !
Fixed windows newline style
Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
Was incorrectly documenting Article instead of Page. Also changed $article
to $page to avoid confusion.
Change-Id: I366769a201b5fda1c8d59119bdac908fd7727cbf
Doxygen expects parameter types to come before the
parameter name in @param tags. Used a quick regex
to switch everything around where possible. This
only fixes cases where a primitve variable (or a
primitive followed by other types) is the variable
type. Other cases will need to be fixed manually.
Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
Added/removed spaces around logical/arithmetic operator
Reduced multiple empty lines to one empty line
Removed wrong tabs before comments at end of line
Removed too many spaces in assigments
Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
- Separate file and class documentation
- Add some missing class documentation
- Fix erroneous documentation
Change-Id: I35c846ad63e837165b79456dc89d330498aebf64
WikiPage::getRevision() and WikiPage::getOldestRevision() may return null
when a revision does not exist; catch this in InfoAction::pageInfo().
Change-Id: If141213aedfe7c55e935105abf4415b6feced57c
It was using Parser::guessSectionNameFromWikiText, which expects
a string of wikitext (e.g. "== Foo ==") and extracts the heading
text, and from that it generates an ID, and from that it
generates an anchor link.
The extraction and anchor link are wrong and caused the output
to be <h2 id="#Foo"> instead of <h2 id="Foo">.
Follows up I702f2f13.
Bug: 44989
Change-Id: I81f67ae1ac86ed709c69f1bced970b2cbb5138db
When a page has fewer than $wgUnwatchedPageThreshold watchers and the
user does not have the 'unwatchedpages' right, the row for number if
watchers is not being displayed at all. This is confusing to some users,
so instead display the row with an appropriate message.
Change-Id: I2425e45ec5db2dc743f875acf3fd3717b7d06286
Long title names caused errors in caching of InfoAction
results, so this commit wraps the title in a SHA1 call
so that all titles will have valid cache keys.
Change-Id: I803a7dd58f5bd69070291192d3eead065d0403f1
To only show rollback links if they work I had to patch Linker
to have a function (Linker::rollbackData) which can verify
that the editor isn't the only editor of the page. Furthermore
it is checked that the user name or the text of the revision
we might rollback to isn't deleted. Due to the fact that I've
altered the already existing method which showed how many edits
a rollback will revert for that, this wont affect the performance.
Change-Id: I5d1adec993370c39ae8c5c712edd919d456441c6
Currently InfoAction lists the pages that are transcluded
onto the specified page. This adds a list of pages on which
the current page is transcluded. Also, it adds an option to
limit the list size for transclusion links due to memory
concerns.
Change-Id: I45b077cf3f241b1927f7b1818b04b72115d55c28
Added a Category information section to InfoAction that
only shows for NS_CATEGORY pages. It lists the number
of pages, subcategories, and files in the category.
Change-Id: Ic8965ffc7e4f9abb1f46d773839bdf5c2f06b72e
If the length of a revision is unavailable, do not show
the page size (or char difference) instead of pretending
it is 0 and showing wrong info.
Change-Id: I2b2ca3da480e9222911ff6a91f3ab1ca4a8b9ba1
Added configuation variable that allows bypassing the unwatchedpages
permission when the number of people watching a page is greater
than a certain threshold. The default value is false, meaning the
unwatchedpages permission is always required.
Change-Id: I1cb6ee22d50d871a8c7083c5b7a091d31cf640f5
Added caching to InfoAction. The cache key uses the ID of the
latest revision so it is auto-invalidated when the page is
changed. Also, the cache key is deleted whenever the page is
purged.
Change-Id: I90446b7bcb4517959605aa38eacfada2b785060b
* @licence -> @license
* Protects inline HTML by using double quotes, our inline comments uses
elements such as <h1> or <firstnameLastname@gmail.com>
* Commands in lowercase (@TODO -> @todo, @NOTE -> @note)
* removes @abstract and @static since doxygen detects them from PHP
code.
* various undocumented function parameters
* typos in parameters declarations
Change-Id: I62ad6fc124c355bf31acc780b9614a59cf79a421
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
Follow up to Change-Id: I17ab90af902b3b23d5c9bc23f0c71a18d1006cb8
fixing minor stuff (using the word separator message to seperate
the page name and (info) and escaping the link text given to
Linker::link)
Change-Id: I6d5e2ecf2c8a9394556426e952812f4b0d2ad529
* Will not display edit history and properties for nonexistent pages
* Will not display misleading page information for noncurrent revisions
Change-Id: I23dd6ead555449d0810cbc64d79737654818e3e6
Also add $context parameter to the hook and (bug 40845) don't
overwrite pageInfo's $title parameter.
Change-Id: I41128abb72553142b45e90befabde541b2d8941f
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
The $title variable is set to $this->getTitle() before its
first use in that method, so it's useless to pass it as parameter.
Also changed the call to exist() in InfoAction::onView() to use
the Page object instead of the Title object.
Change-Id: Ic07ee0ccccfd9cc3aabd497aebf7965136a2d3bd
Created a new method User::groupHasPermission and check also
$wgRevokePermissions for the given right
Change-Id: I41edb091fa35c8c68b6f95cc5fd208ea99418cdb
Looks like this link should have been called $del instead of $cdel.
Needs some verification. Blame came up with Aaron's change in
https://www.mediawiki.org/wiki/Special:Code/MediaWiki/58351. Looks like it may
have been a typo.
Change-Id: I36607e1d1365ddfb0383d68702291509b94a931a
Useful link to talk page for the user
Using Linker::revUserTools to have the striked "username removed"
instead of nothing.
Change-Id: I234cb2a483139407087b18ad47ac5b362b8ee5e9
information to a pages info
* Added new function, pageInfo, to return page information in easily
manipulated format.
* Added call to wfRunHooks.
* Moved credits to follow the footer (this is a change for my
aesthetics that may be reverted, but it also allows admins to more
easily add a horizontal break or some such in pageinfo-footer).
* All messages are escaped.
Have tested extensively, all information is rendered exactly as it
was before as far as I can see.
Change-Id: I702f2f13d3b7af26d89c4fd9002d3161dc7905d2