This is a Workaround for PHP bug <https://bugs.php.net/bug.php?id=49143> (5.3.2. is broken, it's fixed in 5.3.6):
Strip leading backslashes from class names. When namespaces are used, leading backslashes are used to indicate
the top-level namespace, e.g. \foo\Bar. When used like this in the code, the leading backslash isn't passed to
the auto-loader ($className would be 'foo\Bar'). However, if a class is accessed using a string instead of a
class literal (e.g. $class = '\foo\Bar'; new $class()), then some versions of PHP do not strip the leading
backlash in this case, causing autoloading to fail.
amended: as per Jeroen's suggestion, used // for comments and ltrim instead of preg_replace.
Change-Id: I71e0429ed1da5c83262dbf6f989c782385af9bcb
* Added swiftCDNTTL to let the cache TTL be configurable
* Also added swiftCDNPurgable option to disable purges
Change-Id: Ic8e779c20f7501a5a55f4a49fc612923d0dc268c
* This check is similar to the HistoryAction one. It prevents things from
getting cached that do not get purged with the page is invalidated.
Change-Id: Ie38ae198b173533937103d66478a9ccb5b086175
* Made the 'zones' config a bit easier to set by falling back to defaults more piecemeal.
Each zone now also has a 'url' parameter. This is useful for CDN support for third parties.
* Deprecated weirdly name getRootUrl() function and made it wrap getZoneUrl( 'public' ).
Change-Id: I8295a81e9cc56c08069b35fa4e4f883fd0108df7
Fix for r10265: OutputPage::uncacheableBecauseRequestvars() as written
in that revision is backwards, apparently declaring all requests to be
uncacheable except those with useskin or uselang. Luckily getText() has
always converted its default parameter to a string, so the triple-equals
comparisons always fail, and uncacheableBecauseRequestvars() always
returns false.
In any case, it was never necessary to suppress the client-side cache
for useskin/uselang views, so the accidental behaviour was appropriate.
Change-Id: I520940867509b986a47d63ead9b549e8aa82fa1f
Old interfaces are preserved for b/c for now. Stuff that needs to die
such as css_file_name has not been exposed for new interfaces.
Remove unused device properties.
Change-Id: I9b08eb81625a5570e700d9b690c03a001316de71
The current API implementation has a parameter for uploads that is
called "ignorewarnings". Currently, it will not only suppress any
warnings from stopping the upload, it will also lose any data from
those warnings.
This patch is sort of on the way to solving Bug 30625, which is in
the UploadWizard extension. That extension needs to know when a file
upload *will* fail, barring a change in some data, in order to make
it easier for a user to fix the foreseeable problems. The solution is
either to fix it this way, or to somehow spoof a file upload, and see
if it succeeds. In the hopes that other extensions will also find
this useful, I opted for the former.
Change-Id: I08b4e29e89ade6cf391ae044fceb788aaba3f5b4
* Also tweaked timestamp tolerance in tests, intended for Swift
* Also made a few tweaks to speed up tests a bit
Change-Id: Ibdee36d3bf86089b027dc74bb2582acc1ab4b96b
Replaced isBlank() with isDisabled() in SpecialPage::outputHeader.
This allows disabling the default headers (*-summary).
Patch set 2: Hid recentchangestext if nothing is written there.
Change-Id: Id3ec2aeb1fab00344908b7bff01929bdafbfd08f
Add $indexOffset parameter to PPFrame::newChild(). This makes it
possible to use newChild() for interpreting named parameters to
invoke in Scribunto -- otherwise I would have had to duplicate its
functionality, which would have been tricky given that I wanted to
make a real frame with an expand() method. Setting $indexOffset allows
newChild() to start counting numbered parameters from somewhere other
than the first pipe character, leaving room for the Scribunto function
name.
Fixed PPCustomFrame_*::getArguments(), was missing for no apparent
reason. I didn't end up using it in Scribunto, but there's no harm in
adding it anyway.
Change-Id: I0c761aab8a7f1ae74e8d151a1346febb5c466e18
The form was missing the hidden inputs containing the filter options already selected. This change fixes adds those inputs.
Change-Id: I67f3b34672c52c13789a967e81e0cb32813b2be2
* 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