* For some reason, when 404 handling is off, all the links for
$wgImageLimits were still generated but not put into the HTML.
They still triggered convert() calls - 7 times by default.
Change-Id: I0d12c7ec3c02039c1307a1a1d04d1d1cbd44b547
When generalizing LinksUpdate to DataUpdate and introducing
WikiPage::getDeletionUpdates(), WikiPage::doDeleteUpdates()
was removed, even though it was still used by Title::moveToInternal().
This patch restores WikiPage::doDeleteUpdates(), using the
new logic based on WikiPage::getDeletionUpdates() to implement it.
Change-Id: I12a49d5ca3ccb6bb9cbb63dde436bcf2a7d8a985
* Make it executable and use a more generic shebang line.
* Write ZhConversion.php to its own location directly, so it can be more
convenient to do git checkout -b; edits; ./Makefile.py; git diff; to
confirm changes made.
* Cosmetic text changes.
Change-Id: Ia3556e3b2cd5ee4eeaa67c4e535141576f13dc16
some old page_restricions entries are move=:edit=,
which result in any empty string as level in the JS var
wgRestrictionEdit
Checking wgRestrictionEdit.length is than not possible
Change-Id: I250b4f9bda60361d4cd8c3139b17b299fec0a718
* doQuickOperations() lets us do things like purge thumbnails as fast as possible.
Stat calls, SHA1 checks, and RTTs in general are avoided. It also avoids the
slowness of lazy population of thumbnail SHA1s in Swift (for those made by rewrite.py).
* Removed supportedOperations() to avoid the extra complexity.
* Made a few variable type and exception documentation cleanups.
* Cleaned up unit test file removal a bit and made some functions private.
Change-Id: I6922368c6af7752a6927d96402519132203108a1
Add some calls to Database::timestamp
Change some calls from Database::strencode to
Database::addQuotes to avoid ' in raw sql
Remove ' from ints in raw sql
Rename some vars to avoid duplicate names
Change-Id: I63f5602fa968f969a42932902a3ccc45fc54b432
the queries for title and pageids are own queries created by the api,
which does not use the GenderCache, that can produce a query per row
Change-Id: I932f8d9d1cfa751dbb6f5237e2de325527d3ff53
This is needed for mobile scripts that are supposed to work on dumb
devices and as such can't rely on client-side RL, but still can take
advantage of server-side minification and concatenation.
Patchset 2: Allow loading raw modules with &raw=true appended to URL.
Change-Id: I9410ffbf6633075e07bd06b10a98a4d12d9b6106
Fix for r97314: don't log HttpError exceptions to the exception log channel. Do
this by overriding MWException::report() rather than
MWException::reportHTML(), same as every other child class in
Exception.php.
Change-Id: I3fb2b0ca9b0e7c67c210078d1fd90e1430be39df
* Fixed the check for igbinary presence. It's not enough for the
extension to be loaded, the memcached extension also needs to be
compiled with --enable-memcached-igbinary.
* When delete() is attempted on a key that doesn't exist, return true,
as in the other BagOStuff implementations.
Change-Id: I298952f4a9925d860fa5673f632d073b1f20aa47
* Introduced a common base class for the two memcached clients, called
MemcachedBagOStuff.
* Moved the expiry time normalisation from MemcachedClient.php to
MemcachedBagOStuff since libmemcached needs the same workaround.
Change-Id: I507d4ec5a7fd863ae64a94f2c453981f9f03746c
This was an oversight in a69fb48274 which
changed saveContent() (and, by extension, addEntry()) to return a log_id
rather than a boolean.
Also update the documentation comments to reflect this, and remove a
resolved TODO
Change-Id: I8fe269f452f8c8d4fa0318c120b676ac10efebae
This supercedes I6d03bf2a, using better names for the new classes and
incorporating the changes requested by Aaron.
This change introduces the base class SecondaryDataUpdate to be used for any
updates that need to be applied when a page is changed or deleted. Until now,
this was done by the LinksUpdate class for updates and WikiPage::doDeletionUpdates
upon deletion. This patch uses a list of SecondaryDataUpdates in both cases.
This allows extensions (e.g. via the ContentHandler facility, once that is in) to
easily specify what needs to be done when a page is updated or deleted in order to
keep any secondary data stores (such as link tables) in sync.
Note that limited transactional logic is also introduced, so SecondaryDataUpdate
can be implemented to only commit their changes if all updates were performed
sucessfully.
Patch Set 2: fixing some coding style issues mentioned by Nikerabbit.
Patch Set 4: some stuff I kept from the old LinksUpdate class needs cleanup,
but might break extensions when changed. Marking as todo for now.
Patch Set 5: fixed misnamed member in LinksDeletionUpdate (thanks Aaron).
Change-Id: Ibe3e88fadd8c1d4063cf13bb6972f2a23569a73f
This allow to get the queries of the api due the same api request,
when setting $wgDebugToolbar = true, that acts like the inline script
added to index.php
Change-Id: I7c121822827137ba098d95a54ec90f824e0ddf01
This whitespaces causes an extra empty paragraph between text and transcluding a special page.
When a heading precedes a transcluded special page, there is no difference and it's fine with or without this whitespace.
See for example http://incubator.wikimedia.org/w/index.php?title=Incubator:Sandbox&oldid=822299
Change-Id: I6b06006d921368619d3969660c244176344e8aff
Also added "false, false" to Language::time() and Language::date() calls in Special:Lockdb, this is to have the date using the default format and not in the format of the user locking the database.
Change-Id: I9309022b005fcc7d31350242b8989ca7eabf69a8
rename MWNamespace::isNonincludableNamespace
to MWNamespace::isNonincludable, because "Namespace" is already in the
class name
Change-Id: Ie982835c7dc84cb10c823996e5360cc1b342f704
* Note: follows up a4b3979160
* Cleanup up transaction statements a bit; transactions don't effect the lock calls
* Also made DatabaseMysql::unlock() actually return a bool
Change-Id: Iade2efa94165b6918eae0863716cc163f36a07b8
* Show descriptive error message on invalid title
* Call methods directly on ResultWrapper instead of DatabaseBase
Change-Id: Ia437e73546ce664395f07c4a10bad6f04fcfb5d7
Aborting a save from the ArticleSave hook and putting an error in
$status didn't actually propagate the error message to the user, but
instead displayed the edit conflict page (!). Fix this so that if we get
an unrecognized error from ArticleSave, we treat it as an extension
error and render it rather than going into conflict mode.
Similarly, make the API attempt to render the error through
dieUsageMsg() like it already does for AS_END
Change-Id: Iccf78480240d0c7ed321438c8190472805957099
Also made file/class documentation more consistent and removed a duplicate comment from SpecialPageFactory.php in SpecialPage.php.
Change-Id: I99dd2de7fe461f2fad4e0bd315ebc2899958a90f
Also add the requirement that module names be at most 255 bytes, so
they'll fit in the DB fields that we put module names in (md_module,
mr_resource, mrl_resource)
Change-Id: I7193c9beb7aff4eabfe20db461e6f9032ae994b1
* Made SiteStatsUpdate fields protected
* Added factory function for unretarded object construction
* Changed FileRepo code to use deferred stats updates like everything else
Change-Id: I93039104b14f0362509e37b6852604ffb0898dc7
Moved 'recentchangestext' message to 'recentchanges-summary'; left 'recentchangestext' empty by default for wikis that would like to display things in content language on the top of Special:RecentChanges
This a resubmit of r86186 (https://www.mediawiki.org/wiki/Special:Code/MediaWiki/86186) which was reverted in r86294 (https://www.mediawiki.org/wiki/Special:Code/MediaWiki/86294). The revert should have been temporary (at least from commit summary), but it seems that it was not the case.
Change-Id: Ia2061a581f754aa1bc374a615d41e8465996feac
WONTFIX:
* (bug 30245) Use the correct way to construct a log page title.
This was previously reverted for 1.19 and now reverting again for
1.20, only this time proposing it not to be temporary.
Right now this is already live on 2 wikis and as soon as it goes
live on a non-English wiki (since English namespace name for Log
matches the canonical name "Log", and as such causes no breakage yet
for bots using the IRC feed), as soon as it goes live on a
non-English wiki it will all log actions that bots are monitoring
using the irc feed.
(because no matter which log action is monitored, it all goes
back to detecting the page title of Special:Log)
If properly announced ahead of time it could be done, but we don't
have that time anymore. Perhaps re-try in 1.21 or 1.22, but as far
as I'm concerned, this bug can be kept WONTFIX as it only affects
the IRC feed. And it's not worth the loss that will undoubtedly
result from breaking this.
Theoretically a certain amount of time for the announcement could be
required, and if the change enables something or fixes a security
problem, it could be justified, but for this it is just not worth
it.
The human-readable output from the API and on Special:Log are fully
localized and even better so with the rewrite that Niklas did last
year. The IRC feed however, has little to no gain from this and only
causes breakages for the the large amount of bot usage from it, of
which many are no longer maintained and as such will not be fixed,
no matter how much time it is given. Granted those will probably
break no matter what at some point, but hopefully we will have
push notification *with* structured data[2] by that time to
encourage rewrites of those bots.
Change-Id: I229e345c74b10f4d96b8d2d305b4a7623825b3f6
Links:
* https://www.mediawiki.org/wiki/Special:Code/MediaWiki/97711
* https://www.mediawiki.org/wiki/Requests_for_comment/Structured_data_push_notification_support_for_recent_changes
* FS backends work via popen() and basic shell commands.
* Swift backends use the custom SwiftCloudFiles async features.
* Refactored storagePathsRead()/storagePathsChanged() to normalize the paths
for correct dependency detection in FileOpBatch.
* Cleaned up SwiftFileBackend exception handling to make debugging easier.
* Added a quick and dirty performance testing script.
* Updated unit tests to include a run with parallelize=implicit.
* Improved file test failure output a bit.
Change-Id: I6a5ed743c30c598e0dd7301dbdb3631c460332fd
* Show descriptive error message on invalid title
* Don't check for page existence if the query is not cached, since the page must exist to be listed here
* Do a LinkBatch if the query is cached, otherwise we end up with on database query per displayed row
Change-Id: Ia10d0e7d69def0ee1f42727124518bc6f6335dda
* respHeaders contains arrays for each header (should've been
respHeaders['content-length'][0] instead of respHeaders['content-length'])
using getResponseHeader() instead.
* This also fixes InstantCommons, which was broken by this (bug 36653).
* Also cleaned up a bit of w/s in foreign repo code while in the area.
Change-Id: I429b0a36618cc2b873077516e9c1023dc5b7d693
* Purge old version thumbnails on move
* Pushed purge operations outside of the DB transaction for move/delete
Change-Id: I260940149599eea814226d3c5b7092f4d6544a72
Mention ResourceFileCache instead of ObjectFileCache for the $fileCache parameter since the signature is
function tryRespondFromFileCache( ResourceFileCache $fileCache, ResourceLoaderContext $context )
Change-Id: I8e738c847ea358117a2a9b54f41fdb10308e2656
Currently the name of the file is sent without the "File:" prefix making MediaWiki think we want to display a page in the main namespace.
Change-Id: I5a42764c8e9289d13b95a1989be63fdf357bc6ef
* Fixed unlocking logic in FSLockManager for case when an EX lock was made, then an SH one, and then the EX one was "unlocked"
* Avoid hiding useful unlink() warnings in FSLockManager
* Reduced locking use in test cleanup code
* Added a simple testLockCalls() test function
* Made a few cleanups & fixes to backend tests
Change-Id: I1110d9b537c450d9feca5a2fb35519c22435e81d
Explicitly detect circular references in strip tags and break the loop,
similar to how we deal with circular references in templates. This is
necessary to support Scribunto since we imagine we will provide an API
that allows strip markers to be forged.
The recursion depth limit is a consequence of changing the algorithm
from iterative to recursive, it's required to protect the stack against
deeply nested #tag invocations.
Change-Id: Icc8dc4aedbced55ad75b3b5a5429a376d06d9b31
* Make the HTML error message prettier, with a nice red box and
instructions to modify LocalSettings.php hidden in an HTML comment.
* Show the exception class name, since that's pretty safe.
* Show a random "log ID" to the user, and also send it to the exception
log, to allow easier log correlation.
* Optionally send backtraces to the error log, enabled by default.
Change-Id: Ie92e46032b3d194c4217119567847a38a53be577
We detect such prematurely ended request when there's a Content-Length
greater than the body we got. A strict comparison would easily fail
when there was a content encoding layer, but hopefully we won't hit
a compressed request _larger_ than the original content.
See http://thread.gmane.org/gmane.org.wikimedia.mediawiki/39622
for breakage caused by truncated HTTP replies.
Change-Id: I71418424730d46a781bde5cbfda8038457ec79c5
This is required by dump unit testing for now. The change was introduced
by commit ab6e54e0https://gerrit.wikimedia.org/r/#/c/6089/
We will have to update the Dump tests to no more reference sink directly
but use a proper accessing method that has yet to be written.
Change-Id: I1246739c4ea174b13af475db8cfcb48740ecc2df
This method will use two new messages 'invalidtitle-knownnamespace' and 'invalidtitle-unknownnamespace' depending on the fact that the given namespace number exists or not.
I did put that method in Linker because I plan to use it in various places, notably in other QueryPage and Pager subclasses.
Change-Id: I13e7cdc2c0a8e86dc5e4b144b6012f3864d2ec06
No RELEASE-NOTES entry since this is going to be backported and RELEASE-NOTES-1.19 is out of sync.
Change-Id: I1ec6c824677606ac6f93cc43345942e4de8bd3f4
In WikiPage.php:
* Added WikiPage::$mDataLoadedFrom to store the source of the data used to load the state of the object and four new WikiPage::DATA_* constants for its possible values.
* Added WikiPage::convertSelectType() to convert 'fromdb', 'fromdbmaster' and 'forupdate' to the new WikiPage::DATA_* constants.
* Added $options to WikiPage::pageData(), WikiPage::pageDataFromTitle() and WikiPage::pageDataFromId() so that the "FOR UPDATE" option can be passed to DatabaseBase::select().
* Added new possibility "forupdate" to WikiPage::loadPageData() load the data from the master database using SELECT FOR UPDATE; this avoids to have to do this by LinkCache (via Title::getArticleID( Title::GAID_FOR_UPDATE ) )).
* Changed WikiPage::doDeleteArticleReal() to use this new feature so that all the data stored in WikiPage is up-to-date.
My point is also to deprecate the loading using SELECT FOR UPDATE in Title and remove LinkCache::forUpdate() at some point (there are still one usage in Title::moveTo(), two other in UploadFromUrlTest plus some in extensions).
In EditPage.php:
* Don't call WikiPage::clear() after fetching informations from master, this destroys all we work we did to get the correct data.
* Reload the whole data from master using SELECT FOR UPDATE directly in WikiPage and not only in Title. The problem was that before, the up-to-date information was only available in Title and not in WikiPage.
Consider the following sequence from a MySQL prompt (where both revision 1 and 2 belong to page one, revision #2 being the current one):
mysql> UPDATE page SET page_latest=1 WHERE page_id=1;
mysql> COMMIT;
// Now grad the edit form for page #1 from the web and do some changes
mysql> BEGIN;
mysql> SELECT page_latest FROM page WHERE page_id=1 FOR UPDATE;
// Now submit the web form
mysql> UPDATE page SET page_latest=2 WHERE page_id=1;
mysql> COMMIT;
Before you ended-up with a "edit conflict" form with revision #1's text being displayed as current text (even if the texts are mergeable), due to the fact that
in the submit request the WikiPage object was loaded at the moment where page_latest was 1 (certainly due to MySQL's "consistent read" feature) making the
"UPDATE page SET ... WHERE page_id=1 AND page_latest=1" query of WikiPage::updateRevisionOn() return zero row, and thus WikiPage::doEdit returing a fatal Status object with message "edit-conflict".
Now the SELECT FOR UPDATE is done in the WikiPage, meaning that the object has the correct data and EditPage will correctly try to merge the revisions (and show the correct edit conflict if needed).
Change-Id: Ic4878ddb4dd96432b7ecaf43f9f359458d966999
* Make sure locks for file moves cover the whole operation.
* Pushed purging out of the move/delete/restore transactions.
Change-Id: I398c5627808fa79739f0dee632c4edf7416507c1
* Added FileJournal::getChangeEntries() and FileBackend::getJournal().
* Added a script to sync one file backend from another, using the journal of the later.
* Removed some overzealous exception catching in FileJournal.
Change-Id: I6cc8d4fa2479dcf88878dc0b351b3cc92f4a5ad5
by default tidy does not support html5 tags.
TimedMediaHandler outputs video, audio and source
To make TimedMediaHandler work with $wgUseTidy = true,
those tags need to be allowed in tidy.conf:
new-inline-tags: video,audio,source,track
Fixes#30541
Change-Id: I528c9521e9277be308a6a75cc3fc57c83905b5df
My git remote is configured just to be ssh://review/mediawiki/core.git
and I have "review" set up in $HOME/.ssh/config.
Unfortunately, I need to change git remote URLs to make sure
the repository is linked from Special:Version.
This shouldn't be necessary; either we should fallback to the
official MediaWiki git repository or we should add the configuration
option to adapt to local needs.
Change-Id: I2e0b6470c16ec36d0e94cceab844f4a4c4334067
Mark gettoken param as deprecated, so users can fix their tools.
The second part will remove the support for gettoken from ApiMain,
but that is in the future.
Change-Id: I369ddc740c38d80aa8389544087ac6671cabc618
Follow up to I0d6c654a7354ba77e65e338423952a6a78c1150f.
I have also added a URL to a help page on mw.org.
Change-Id: Ie223930cfc313aff150e2dcfd70b74bf4360a8a8
- For consistency with wfCgiToArray()
This way instead of the other way around to keep lowerCamelCase natural.
Change-Id: If4528f6572afeab42ef0602a427ac44da9830a3f
Method is a wrapper around $wgNonincludableNamespaces,
replaced the one place in parser and
add it as info to api's meta=siteinfo
Change-Id: I501b811137c39f5c2d9ea35c78fef8ae22d21bfe
With 1.20wmf2 we get a tracking category with all the problem pages,
seeing the limit for a page is a helpful information than
Change-Id: I1916e5fa6de06b923a01cf1f0ca9362287a9fd70
I know there's no second parameter to WikiPage::newFromID(), but this will change soon.
This follows-up I098dd36619fff3610be6894037220d3472b809d5.
Change-Id: Ic28b7e05db51e55a5f49fed70c042ba11e4d97fe
* Avoid using FileRepo functions to stat cache files as we override/hack
fileExistsBatch(). Instead, use the FileBackend object directly.
* Adding missing prepare() call to unbreak thumbnail cache.
* Added a warning and sanity check for mwstore:// paths rather than appending them
to URLs and shipping them off to Commons. This seem to be mostly gone now though.
* Removed useless error suppression calls that were broken due to a "return" statement.
Change-Id: Ie760f09e6bfa1752544cdb60018513ffc7823496
Previously, whenever we blocked a user, its IP address would be
autoblocked whenever he tries to edit a page. Thus when later unblocking
the username, he would be automatically blocked again if we forgot to
clean up is IP.
This patch introduces a the ipb_parent_block_id column in ipblocks table
to track which block triggered the autoblock command. Thus, when deleting
the original block we can easily remove all subsequentautoblocks.
Schema updaters for MySQL, SQLite and postgres have been added to the
patch but not for the other database types such as ibm_db2, mssql and
Oracle.
Change-Id: I4aa820ae9bbd962a12d0b48b6c638a1b6ff4efc9
Original patch by Nischay Nahata.
Patchset2: amended commit message to be shorter and clearer.
Patchset3: use wfMessage()->text() instead of default parse()
Patchset4: remove unneeded tabs.
Patchset5: added git difference-title to maintenance/language/messages.inc .
Patchset6: moved OutputPage::setPageTitle() calls to DifferenceEngine and added difference-title-multipage message
Patchset7: Fixed an error in messages.inc from the last changeset
Patchset8: Removed the diff page subtitle according to Brion's
suggestions. Note: I am doing this almost a month since
committing the original patch. Rebasing proved to be too
tricky, so I tried to cherry-pick the original commit
in a new branch. Apparently, Git identified it. If this
works as planned, it must be a miracle.
Patchset9: removes unneeded changes to message files
Change-Id: I4e6363529a1e77a3f5267ec6871e8dea0354f043
No idea why mysql_fetch_object() returns string when the field in defined as integer, but it is so on my machine...
Change-Id: I353c6087d20d7a72d6d4b39bdc477b094bc460f6
per pageid
Move the possibles errors set by ApiBase::getTitleOrPageId to
ApiBase::getTitleOrPageIdErrorMessages and remove it from used modules
Change-Id: If037e04665d2524c1f2476bc7996d9573753a4b8