Commit graph

1251 commits

Author SHA1 Message Date
jenkins-bot
be619b8386 Merge "Add additional tracking information to mediawiki.searchSuggest" 2016-03-04 20:10:17 +00:00
Erik Bernhardson
c1159337a9 Add additional tracking information to mediawiki.searchSuggest
Adds a few pieces of information to improve tracking of autocomplete
usage.

* When using Special:Search 'go' feature forward wprov parameter to redirect
* Include a data attribute indicating autocomplete location to
  differentiate usage of the header and Special:Search content autocompletes
* Report exact query string that was used for impression-results
* Add handling to allow searchSuggest subscribers to append tracking
  information to generated article links
* Add a new hook, SpecialSearchGoResult, that can either change the url
  redirected to in the 'go' feature or cancel it entirely.

Bug: T125915
Change-Id: Iec7171fcf301f1659d852afa87ce271f468177c1
2016-03-04 11:53:39 -08:00
Timo Tijhof
38a59662bb user: Remove obsolete note in docs/memcached.txt
The User object cache hasn't been that since b3acd4f.

Change-Id: Ia7ab78ef22c24a7421ea25db1440e7267f0a725d
2016-03-01 22:39:23 +00:00
Matthew Flaschen
793499cde0 Add TitleMoveStarting, mirroring TitleMoveCompleting
This is a pre-requisite to fix a Flow move regression, T127785.

This allows running an atomic entirely within the move with the correct
ordering.

Bug: T127785
Change-Id: Ie772f737f917854e4cfefe52ec3bea4669c9efe0
2016-02-25 13:31:04 -05:00
Stanislav Malyshev
c7c063430f Deprecate PrefixSearchBackend
Change-Id: I9a8d3113f0428294db847638365fb0233c93d9ac
2016-02-19 15:30:23 -08:00
jenkins-bot
b8197b1e41 Merge "Add 'reason' to UserGroupsChanged hook" 2016-02-16 06:56:14 +00:00
Ricordisamoa
179017976f Make maintenance/findHooks.php pass again
* check 4 new paths

* strip 'NormalizeMessageKey' hook from docs/hooks.txt,
  last call was removed in 1ea4f23b05

Change-Id: Id36ab478b94f74be451cae848d5ef2a318d23040
2016-02-13 20:06:12 +00:00
Stephane Bisson
c762e0ced9 Add 'reason' to UserGroupsChanged hook
Used by Echo to display the reason in the 'user-rights' notifications

Bug: T126277
Change-Id: Ib9bb28a7a77602e3e729fd0bf13ab8259e15b006
2016-02-12 14:54:35 -05:00
Bryan Davis
cfbc25c5a5 Allow changing cookie options in WebResponseSetCookie hook
Pass the cookie options by value to WebResponseSetCookie handlers so
that they may alter them.

Bug: T49647
Change-Id: I69ae55baa7806f14726b0b08215c0df471794b39
2016-02-10 15:49:08 -07:00
Bene
9e3e3306b0 Allow callbacks to be passed to $wgContentHandlers
Change-Id: Icf980313a6e7fcc83f5183c450b0a824353596b8
2016-02-06 09:48:11 +01:00
Brad Jorsch
2257fe4228 Revert "Remove SessionManager, temporarily"
This reverts commit 823db5d63dd5200d04c63da50ba6bf16f928e70b.

Change-Id: Ibb3e023e4eb6715295586dea87d0725c344a8271
2016-02-03 21:44:59 +00:00
jenkins-bot
4dc3ac1c37 Merge "New hook for filters on Special:Contributions form" 2016-02-01 22:47:40 +00:00
Brad Jorsch
5083e810eb Remove SessionManager, temporarily
The plan here is to take it out of 1.27.0-wmf.12 and put it back in
1.27.0-wmf.13.

Since BotPasswords depends on SessionManager, that's getting temporarily
removed too.

This reverts the following commits:
* 6acd424e0d SessionManager: Notify AuthPlugin before calling hooks
* 4d1ad32d8a Close a loophole in CookieSessionProvider
* fcdd643a46 SessionManager: Don't save non-persisted sessions to backend storage
* 058aec4c76 MessageCache: Don't get a ParserOptions for $wgUser before the end of Setup.php
* b5c0c03bb7 SessionManager: Save user name to metadata even if the user doesn't exist locally
* 13f2f09a19 SECURITY: Fix User::setToken() call on User::newSystemUser
* 305bc75b27 SessionManager: Don't generate user tokens when checking the tokens
* 7c4bd85d21 RequestContext::exportSession() should only export persisted session IDs
* 296ccfd4a9 SessionManager: Save 'persisted' flag in session metadata
* 94ba53f677 Move CSRF token handling into MediaWiki\Session\Session
* 46a565d6b0 Avoid false "added in both Session and $_SESSION" when value is null
* c00d0b5d94 Log backtrace for "User::loadFromSession called before the end of Setup.php"
* 4eeff5b559 Use $wgSecureCookie to decide whether to actually mark secure cookies as 'secure'
* 7491b52f70 Call session_cache_limiter() before starting a session
* 2c34aeea72 SessionManager: Abstract forceHTTPS cookie setting
* 9aa53627a5 Ignore auth cookies with value 'deleted'
* 43f904b51a SessionManager: Kill getPersistedSessionId()
* 50c5256352 SessionManager: Add SessionBackend::setProviderMetadata()
* f640d40315 SessionManager: Notify AuthPlugin when auto-creating accounts
* 70b05d1ac1 Add checks of $wgEnableBotPasswords in more places
* bfed32eb78 Do not raise a PHP warning when session write fails
* 722a7331ad Only check LoggedOut timestamp on the user loaded from session
* 4f5057b84b SessionManager: Change behavior of getSessionById()
* 66e82e614e Fix typo in [[MediaWiki:Botpasswords-editexisting/en]]
* f9fd9516d9 Add "bot passwords"
* d7716f1df0 Add missing argument for wfDebugLog
* a73c5b7395 Add SessionManager

Change-Id: I2389a8133e25ab929e9f27f41fa9a05df8147a50
2016-02-01 22:06:49 +00:00
Aaron Schulz
334e8f8f9d Remove $wgEnotifUseJobQ
Always treat this as on and simplify the code.
This will also make it easier to move updateWatchlistTimestamp() into
the EnotifNotifyJob class to avoid query timeouts.

Change-Id: I8ceaa42cdcfe3ad00a26368be6a73052be329045
2016-01-29 12:24:16 -08:00
jenkins-bot
a218a56b77 Merge "Add ParserOutputStashForEdit hook for extension cache warming" 2016-01-28 23:13:06 +00:00
Brad Jorsch
94ba53f677 Move CSRF token handling into MediaWiki\Session\Session
User keeps most of its token-related methods because anon edit tokens
are special. Login and createaccount tokens are completely moved.

Change-Id: I524218fab7e2d78fd24482ad364428e98dc48bdf
2016-01-27 15:27:20 -05:00
Adam Roses Wight
05da5bbea0 New hook for filters on Special:Contributions form
Bug: T124857
Change-Id: I56a3f13e8888202f832c5c18c92f3ff899f032f2
2016-01-26 20:29:16 -08:00
Aaron Schulz
d478d4a154 Add ParserOutputStashForEdit hook for extension cache warming
This can pre-cache slow queries by extensions that happen on
edit submission.

Bug: T116557
Change-Id: I803f69013f68e80a53dd3c466bddff3ebe2b659b
2016-01-26 17:23:56 -08:00
georggi
280f07725e Hooks: Added ImportLogInterwikiLink hook
ImportLogInterwikiLink. Hook to change the interwiki link used in log entries and edit summaries for transwiki imports.

Change-Id: I03e054de16d8820c0f3d2c165288e229960d6bb1
2016-01-16 13:05:17 +02:00
Brad Jorsch
a73c5b7395 Add SessionManager
SessionManager is a general-purpose session management framework, rather
than the cookie-based sessions that PHP wants to provide us.

While fallback is provided for using $_SESSION and other PHP session
management functions, they should be avoided in favor of using
SessionManager directly.

For proof-of-concept extensions, see OAuth change Ib40b221 and
CentralAuth change I27ccabdb.

Bug: T111296
Change-Id: Ic1ffea74f3ccc8f93c8a23b795ecab6f06abca72
2016-01-12 21:57:01 +00:00
Florian
336736af4f Post-document hook AfterBuildFeedLinks
Follow up: If48bd07a0e7e67fd1c1a94ebaa28ca9dae146c55

Change-Id: I9080a150354b978098b8bf4e279f26fdc2ac7c8e
2016-01-09 17:46:14 +01:00
jenkins-bot
13e788862b Merge "Add hook to allow extensions to modify query used by Special:ShortPages" 2016-01-06 19:40:57 +00:00
Kaldari
0db94b498f Add hook to allow extensions to modify query used by Special:ShortPages
Also fix USE INDEX so that it won't break if another table is joined.

See related change at I2a7003f9.

Bug: T53124
Change-Id: I9ac910bc4c24196b1f19e2fc7f1e5b88a0dac41b
2016-01-06 10:53:58 -08:00
mhutti1
476f55fe0a registration: Allow setting $wgFeedClasses in extension.json
Bug: T122770
Change-Id: I5362ec4c6ea01f4d49d576d5767e9cce4f421046
2016-01-03 22:03:17 +00:00
Kunal Mehta
2d534f3ea6 registration: Allow setting $wgCentralIdLookupProviders
Follows up d032bb52cd.

Change-Id: I43f4fb3d7b2fafc437abcfda73bf865aa8600ba2
2016-01-02 16:09:23 +00:00
victorbarbu
7489cdfc05 registration: Allow loading composer's autoloader if it exists
Extensions that have composer dependencies can set
 "load_composer_autoloader": true
to load "$dir/vendor/autoload.php" if it exists.

While it is recommended to use composer-merge-plugin to manage
composer dependencies for extensions, using a local autoloader
can be easier for development and is used by ExtensionDistributor.

Bug: T119766
Change-Id: Ib031bef17c8a7d708a5c7878e74967d19217bbc8
2015-12-29 23:20:17 +00:00
Aaron Schulz
87f54c37f1 Add $revision to TitleMoveCompleting for completeness
Follow up to 9cc2f62bf5.

Change-Id: Ibb48f6673b9be1863563262fff8bedc5aed7926c
2015-12-16 19:11:15 -08:00
Eric Evans
9cc2f62bf5 Pass created revision to TitleMoveComplete hook
The EventBus extension needs to forward the created (null) revision ID as
part of the page move event.  Looking this value up when the hook fires is
problematic, because without a connection to the master DB the query might
very well return nothing (if it races in before the entry is replicated to
the slave).

This changeset passes the newly created Revision on to the hook so that it
doesn't need to be queried separately.

Bug: T116786
Change-Id: I1b48e2904fc8d99f2cde604f274f79a2b47d7fc2
2015-12-16 18:35:56 -06:00
cenarium
68692ebb69 Add user and previous rev to HistoryRevisionTools, and user to DiffRevisionTools
The next revision in the page history isn't necessarily the previous
revision (due to selective undeletions, history merges, etc). This
passes the next revision to HistoryRevisionTools so extensions can check
if needed. Also, it passes the user to this hook and DiffRevisionTools
to avoid use of wgUser or having to retrieve context.

Change-Id: Ibc68f19040eebe3614e07f753f26bbfd376ae28d
2015-12-14 00:35:59 +00:00
Ori Livneh
cd78210ee7 Remove wfIsTrustedProxy(), deprecated since 1.24
No usage outside of core:
https://github.com/search?utf8=%E2%9C%93&q=%40wikimedia+wfIsTrustedProxy&type=Code&ref=searchresults

Change-Id: I86439a772e036dcd5ebdd8b16010c7bacfd9463b
2015-12-13 22:07:41 +00:00
Aaron Schulz
d0b9ffed76 Make TitleMoveComplete hook events apply in transactions
* All updates for an event are atomic for the main DB.
* This follows-up 9e51328790 by reverting the auto-commit
  behavoir which was a side-effect of that change.
* Added TitleMoveCompleting hook with is a pre-commit version
  of the same hook. Various extension could benefit from the
  atomicity of running in the main transaction.

Change-Id: Ife5990bbedca1de78bcf83f2d6fdeeae8086ffad
2015-12-09 18:23:49 +00:00
Timo Tijhof
ade945b97a Remove obsolete showCacheStats.php and showCacheStats.php
These scripts interact with keys that used to be set by ParserCache.php.
However this hasn't been the case for a long time now. They use wfIncrStats(),
which is configured by $wgStatsdServer.

Change-Id: Id6a62aec57801085ed684af9362a96eca0914e92
2015-12-07 19:49:29 +00:00
Kunal Mehta
585c0398af registration: Remove type validation for "config" items
The type list was missing "number" for doubles, but since we allow *all*
types of variables, don't even bother checking types.

Bug: T120507
Change-Id: I10626f5764f49d4f96a3cc35a27c890905a71bfe
2015-12-04 21:04:51 -08:00
umherirrender
a628f41ea9 Allow findHooks.php to compare parameter references of hooks
Check if all hooks in hooks.txt have a &, if the code also have & and
the other way round.

Fix all hooks in hooks.txt to have a clean run of the script.

Change-Id: I1b45253e20dc310e825cdc17e0e2e9c8fb315bab
2015-11-18 16:19:34 +00:00
umherirrender
01eb216c5f Allow findHooks.php to compare parameter count of hooks
All wrong hook documentation gets fixed with own patch sets:
https://gerrit.wikimedia.org/r/#/q/project:mediawiki/core+branch:master+topic:hooksdoc,n,z
and Iae0285b1a39cf851aaaa735cb22e95c839813997

Change-Id: I5991c4f0ff3ed1fbad18a38169a62d406bf4d105
2015-11-18 10:13:07 +00:00
jenkins-bot
0183ae1453 Merge "Allow passing detailed permission errors data to API" 2015-11-04 22:38:47 +00:00
Ori Livneh
9866995f35 hooks.txt: don't use deprecated hooks in examples
Change-Id: I01228e066de46f91d452767516ae0a11a9915bef
2015-11-03 18:19:10 -08:00
Bartosz Dziewoński
92c29b8891 Allow passing detailed permission errors data to API
Using the new system introduced in
1c57794e37 (see T47843).

This change allows Title::getUserPermissionsErrors() to include
MessageSpecifiers instead of string message keys in its return value.
This doesn't seem to have any bad effects, and should work seamlessly as
long as callers aren't trying to do anything stupid and just pass the
value to PermissionsError or OutputPage::showPermissionsErrorPage()
or wfMessage() or some such.

If the callers *are* trying something stupid, nothing worse than
duplicated or otherwise less-than-perfect error messages (in code
which tries to handle some message keys specially) should happen.
(I fixed wfMergeErrorArrays(), but who knows what else lurks in all
this code.) Any problems should only affect new-style errors using
MessageSpecifier, though.

Since MessageSpecifiers tend to be stringable, we probably won't get
fatals, but might get incorrect checks. Should we try to log this
happening somehow?

Goes with I42a0c5b0ea7e61088dd609b764dd7d1396c60cd5 in TitleBlacklist.

Bug: T115258
Change-Id: I1334ba21a2862973a9d8ff5be2c9bec06a82698b
2015-11-02 17:11:50 +01:00
umherirrender
032914d65b Fixed arguments syntax in hooks.txt
BaseTemplateAfterPortlet: Add colon to match the other arguments
FileUpload: Adjust spacing to match the other arguments

Change-Id: Iae0285b1a39cf851aaaa735cb22e95c839813997
2015-10-31 19:14:29 +01:00
Kunal Mehta
7014e432cf registration: Support custom classes in "ResourceModules" schema
Instead of expecting everything to be a ResourceLoaderFileModule, use
the "anyOf" property to validate against multiple schemas. The following
schemas are now allowed:
* The ResourceLoaderFileModule schema, now with the "targets" property
* A schema for ResourceLoaderImageModule
* A generic schema that requires the "class" property is set, but not to
"ResourceLoaderFileModule" or "ResourceLoaderImageModule".

The last schema will allow for any custom ResourceLoaderModule class to
be set in extension.json with arbitrary parameters.

One downside of this is that the error messages shown when a file does
not validate get a little more confusing, as it shows the error messages
for each schema it does not match.

Bug: T105236
Change-Id: I5e4bfa69c733187c7b27294c159cac05b3b92e81
2015-10-27 04:45:27 +00:00
Alex Monk
8223023be3 Add $suppress to ArticleDelete hook
We should be telling extensions whether a deletion is a suppression or not, so
they can behave appropriately.

Change-Id: I2cb6ffd61dd12766fe0266514c9360ff0c90b788
2015-10-14 16:06:46 +00:00
jenkins-bot
b3a3a97adc Merge "Added autopatrol parameter to MarkPatrolled and MarkPatrolledComplete hooks" 2015-10-13 13:04:02 +00:00
Lojjik Braughler
4e6b945b95 Added autopatrol parameter to MarkPatrolled and MarkPatrolledComplete hooks
Change-Id: Ibc832ba8cec8eaef673ef07534c5522f678e8f58
2015-10-12 16:13:36 -04:00
jenkins-bot
e36e7e352f Merge "Pass the search term into the SpecialSearchResultsAppend hook" 2015-10-07 10:37:50 +00:00
Gergő Tisza
4d7e8b44fb Add UserMailerTransformX and UserMailerSplitTo hooks
UserMailerTransformContent allows extensions to change the body of
an email sent via UserMailer::send(). This is applied before
low-level transformations such as multipart or content encoding.

UserMailerTransformMessage is similar but it is run after those
transformations.

UserMailerSplitTo allows extensions to request that a certain
user should always be emailed separately (so when UserMailer::send()
is called with an array of target addresses, that user will be split
out into a separate call). This is intended for content
transformations which need to be different per user, such as
encryption.

A side effect is that while before a call to UserMailer::send() was
either fully succeeded or fully failed, now the message might be
delivered to some targets but not others. send() will return a failed
Status object in those cases.

Bug: T12453
Change-Id: I4c3a018110173c3b5d52a753fdcbec397b590ced
2015-10-06 13:31:13 -07:00
Marius Hoch
ffe2a44af7 Pass the search term into the SpecialSearchResultsAppend hook
Very useful to do things that need to know the actual search
term (eg. to show further things related to that).

The old hook supported that as well, as documented on
https://www.mediawiki.org/wiki/Manual:Hooks/SpecialSearchResultsAppend

That hook has been re-introduced with e7551f16

Change-Id: I7ac6ad95b29f9da0802eb3340e27b8683bf9f76d
2015-10-04 22:47:01 +02:00
jenkins-bot
f484b8c44e Merge "Fix hook doc for SkinTemplateBuildNavUrlsNav_urlsAfterPermalink" 2015-09-25 19:47:08 +00:00
jenkins-bot
b2c0705b81 Merge "Fix hooks documentation for ArticleProtect/ArticleProtectComplete" 2015-09-25 19:47:04 +00:00
jenkins-bot
ed2d25eb0e Merge "Fix hook documentation for PageHistoryLineEnding" 2015-09-25 19:46:57 +00:00
jenkins-bot
e0663428d8 Merge "Fix hook documentation for ImagePageFileHistoryLine" 2015-09-25 19:37:58 +00:00