Brad Jorsch [Fri, 9 Mar 2018 19:11:36 +0000 (14:11 -0500)]
Remove useless use
A use declaration for a non-namespaced class in a non-namespaced context
causes a PHP warning.
Bug: T189302
Change-Id: I023e64c8194dd03cc3a1098e2d60c73f99bb02e3
Jayprakash12345 [Fri, 9 Mar 2018 13:06:58 +0000 (13:06 +0000)]
Remove deprecated function wfBaseConvert()
Bug: T189300
Change-Id: I5f05beb105dca8e8079e770df562c004a689c2ed
jenkins-bot [Fri, 9 Mar 2018 11:33:10 +0000 (11:33 +0000)]
Merge "Replace wfGetLBFactory"
jenkins-bot [Fri, 9 Mar 2018 10:45:53 +0000 (10:45 +0000)]
Merge "purgeExpiredUserrights: Show number of rows purged"
jenkins-bot [Fri, 9 Mar 2018 10:37:27 +0000 (10:37 +0000)]
Merge "Fix spelling mistake inside API i18n message"
Southparkfan [Thu, 8 Mar 2018 22:13:35 +0000 (22:13 +0000)]
Fix spelling mistake inside API i18n message
Change-Id: Ief2814e2fdd94b68eb6a52261b3aa4f47009bfc6
jenkins-bot [Fri, 9 Mar 2018 00:25:59 +0000 (00:25 +0000)]
Merge "rdbms: small cleanups to session loss handling"
jenkins-bot [Thu, 8 Mar 2018 23:15:23 +0000 (23:15 +0000)]
Merge "Update OOUI to v0.25.3"
Brad Jorsch [Thu, 8 Mar 2018 21:46:08 +0000 (16:46 -0500)]
Typo fix
Bug: T189251
Change-Id: I5e7af2629d566181f3280049b6847c0126850ff2
Aaron Schulz [Thu, 8 Mar 2018 20:40:07 +0000 (12:40 -0800)]
rdbms: small cleanups to session loss handling
Split the two callback runner calls in handleSessionLoss() into two
separate try/catch loops. Return the first exception, if any.
Also make the $recoverable check for connection loss in Database::query
slightly more readable by checking the positive rather than the negative.
Change-Id: I75935fa69e40450ac3983f0d3451ab3001650b6f
Translation updater bot [Thu, 8 Mar 2018 21:23:54 +0000 (22:23 +0100)]
Localisation updates from https://translatewiki.net.
Change-Id: I34c71561c72518697570e7f35bbf3e5ca6ea8e3d
jenkins-bot [Thu, 8 Mar 2018 20:28:42 +0000 (20:28 +0000)]
Merge "Job::insert: Hard deprecate (soft-deprecated in 1.21!)"
James D. Forrester [Tue, 6 Mar 2018 17:08:09 +0000 (17:08 +0000)]
Drop OpenSearch::getOpenSearchTemplate(), deprecated in 1.25
Change-Id: Ib76b96cf392b7f9fa38d28173dd2cd170e08a881
Timo Tijhof [Thu, 8 Mar 2018 04:10:13 +0000 (20:10 -0800)]
rdbms: Restore test for Database::setFlag()
Follows-up
b4eb1feed05b5, which inadvertendly replaced the setFlag()
test with the clearFlag() test.
Also move the test to the DatabaseTest.php file given it's only
executing and covering base class.
Change-Id: I2f4ed6c4eeba845eb67013e1ab7d2b2bde863119
jenkins-bot [Wed, 7 Mar 2018 23:54:06 +0000 (23:54 +0000)]
Merge "Self links should not be marked as legacy css"
jenkins-bot [Wed, 7 Mar 2018 23:01:04 +0000 (23:01 +0000)]
Merge "maintainance: Re-order OOUI script to be clearer, rename"
jenkins-bot [Wed, 7 Mar 2018 22:58:26 +0000 (22:58 +0000)]
Merge "tables.sql: Correct lie about ct_params being unused"
Roan Kattouw [Wed, 7 Mar 2018 22:48:26 +0000 (14:48 -0800)]
tables.sql: Correct lie about ct_params being unused
It is used by ContentTranslation to store things like
{"from":"es","to":"en"}
Change-Id: I880ecc74ab46dde2fa00ddb7baea08edeabcf676
Kunal Mehta [Wed, 7 Mar 2018 21:26:27 +0000 (13:26 -0800)]
Update wikimedia/remex-html to 1.0.3
Depends-On: I537768aa34f0bfa8da3aa401d9a7c4b8ba380508
Change-Id: Ifedb963c4ddf941c46bea9527fd8860b273e2d71
Translation updater bot [Wed, 7 Mar 2018 21:23:54 +0000 (22:23 +0100)]
Localisation updates from https://translatewiki.net.
Change-Id: Ifae4500f5cfbeb69cf8a055b7d0274898ea68fee
Aaron Schulz [Fri, 2 Mar 2018 05:25:00 +0000 (21:25 -0800)]
Remove FakeDatabaseMysqlBase test class
Improve some flag tests that did not seem to test much
Change-Id: Iecfc877645cc66cb696beb2b314a6d149745a530
James D. Forrester [Wed, 7 Mar 2018 18:34:28 +0000 (18:34 +0000)]
maintainance: Re-order OOUI script to be clearer, rename
Change-Id: I6fa9b4840a4b01a71aeb618973f4b858fa1a6c9c
Volker E [Wed, 7 Mar 2018 07:13:15 +0000 (23:13 -0800)]
Update OOUI to v0.25.3
Release notes:
https://phabricator.wikimedia.org/diffusion/GOJU/browse/master/History.md;v0.25.3
Depends-On: I4b847a3e253def12ba1fa15607e1700a4a2c236a
Change-Id: Id10209ea2e36beaac36a0d3509edaa83442290b4
jenkins-bot [Wed, 7 Mar 2018 17:21:12 +0000 (17:21 +0000)]
Merge "Restore index forcing in ContribsPager"
jenkins-bot [Wed, 7 Mar 2018 15:06:05 +0000 (15:06 +0000)]
Merge "Introduce IDatabase::buildIntegerCast"
jenkins-bot [Wed, 7 Mar 2018 15:06:02 +0000 (15:06 +0000)]
Merge "Introduce IDatabase::buildSubstring"
Fomafix [Wed, 7 Mar 2018 13:16:02 +0000 (14:16 +0100)]
Article.php: Use BCP 47 language code for HTML attribute lang
Change-Id: If2194fbb98cbab284aba74e127cc3953a5714b9b
addshore [Sun, 4 Mar 2018 13:50:28 +0000 (13:50 +0000)]
Introduce IDatabase::buildIntegerCast
Change-Id: Ib24856d1ebe017ff07ae497972c764b4a3f3c7df
addshore [Sun, 4 Mar 2018 13:23:39 +0000 (13:23 +0000)]
Introduce IDatabase::buildSubstring
Change-Id: I96f3e0c4920d52f63175cb6767c149f20a8a8cde
jenkins-bot [Wed, 7 Mar 2018 10:55:43 +0000 (10:55 +0000)]
Merge "Add support for 'hu-formal'"
Translation updater bot [Wed, 7 Mar 2018 07:02:09 +0000 (08:02 +0100)]
Localisation updates from https://translatewiki.net.
Change-Id: I8d388605f385e8be40f22459be2cda7105ce6600
jenkins-bot [Wed, 7 Mar 2018 05:49:24 +0000 (05:49 +0000)]
Merge "Use `class="free external"` only on unbracketed URLs"
C. Scott Ananian [Wed, 28 Feb 2018 21:11:09 +0000 (16:11 -0500)]
Use `class="free external"` only on unbracketed URLs
The ability for URLs to be marked free even if they use bracketed syntax
but "sorta look free" (aka unbracketed) was added 13 years ago in
2d71cb30802e5cb78a423a1699ad87e23bfe9f4e (r7074).
It seemed like a reasonable idea at the time: make printed output a little
prettier by marking "sorta free" URLs as free. But this complicates the
semantics of wikitext, and introduces all sorts of strange corner cases,
for example:
[http://example.com/& http://example.com/&]
isn't marked as free, even though the parser output is:
<a rel="nofollow" class="external text" href="http://example.com/&">http://example.com/&</a>
This functionality isn't actually needed: if you want the pretty printed
output of an unbracketed URL, then actually use an unbracketed URL.
In recent years we're more concerned with simplifying the semantics of
wikitext and eliminating corner cases, such that the content of our wikis
can be effectively archived. The "effectively free" URLs are low-hanging
fruit in this quest.
Change-Id: I339e8698786c60c96a37a73443cb9a04362662c4
jenkins-bot [Wed, 7 Mar 2018 04:25:32 +0000 (04:25 +0000)]
Merge "Allow querying contributions of interwiki usernames"
C. Scott Ananian [Tue, 6 Mar 2018 22:26:16 +0000 (17:26 -0500)]
Sync up with Parsoid parserTests.txt
This now aligns with Parsoid commit
7d2a92f81ebbc0941e8fba2a136f5929406ea5e6
Change-Id: I0b57b1bd3b0802ce08249dd0bf376b931d8c7698
jenkins-bot [Tue, 6 Mar 2018 22:27:42 +0000 (22:27 +0000)]
Merge "Use RemexHtml as the tidy implementation for parser tests"
Translation updater bot [Tue, 6 Mar 2018 20:57:42 +0000 (21:57 +0100)]
Localisation updates from https://translatewiki.net.
Change-Id: Ic9ff9f542c9e630bcac1d4037ca3e8faf2dbcb03
jenkins-bot [Tue, 6 Mar 2018 20:02:12 +0000 (20:02 +0000)]
Merge "Change Recent Changes "Number of edits..." preference message"
Brad Jorsch [Mon, 12 Feb 2018 15:11:40 +0000 (10:11 -0500)]
Allow querying contributions of interwiki usernames
Both for Special:Contributions and ApiQueryUserContributions.
Bug: T187079
Change-Id: I4398e473b90172851e875b3f219f7076dceda66c
jdlrobson [Tue, 6 Mar 2018 18:04:12 +0000 (10:04 -0800)]
Self links should not be marked as legacy css
Bug: T181472
Change-Id: Ia19a223a2393d5920ae044c396dc25e80354b3fe
Brad Jorsch [Tue, 6 Mar 2018 17:07:55 +0000 (12:07 -0500)]
Restore index forcing in ContribsPager
For now at least this will avoid a filesort for some cases. But it might
start misbehaving again when $wgActorTableSchemaMigrationStage is set to
WRITE_BOTH or WRITE_NEW.
Bug: T189026
Change-Id: Idd987181b17b824fdf1094f5c3b1c689b1792eb0
Brad Jorsch [Tue, 6 Mar 2018 16:18:45 +0000 (11:18 -0500)]
Don't target log_user_text for registered users
Apparently when log_user_text was added no one bothered to populate it
for existing rows. Sigh, #Technical-Debt.
Bug: T188826
Change-Id: Ice1e6454e439a4abdf9594f6e964478dd484bc20
jenkins-bot [Tue, 6 Mar 2018 12:47:42 +0000 (12:47 +0000)]
Merge "mediawiki.special.apisandbox: Reorder functions"
jenkins-bot [Tue, 6 Mar 2018 02:53:18 +0000 (02:53 +0000)]
Merge "Introduce DatabaseLogEntry::newFromId"
jenkins-bot [Tue, 6 Mar 2018 01:51:27 +0000 (01:51 +0000)]
Merge "Add test for WikiPage post-edit stats update"
jenkins-bot [Tue, 6 Mar 2018 01:21:46 +0000 (01:21 +0000)]
Merge "rdbms: cleanup some type checks and documentation"
Aaron Schulz [Wed, 28 Feb 2018 02:01:02 +0000 (18:01 -0800)]
Add test for WikiPage post-edit stats update
Bug: T187585
Change-Id: I734b7f42799a9bfe77a1fb1269bb3d48b3852ffd
Max Semenik [Sat, 3 Mar 2018 03:56:39 +0000 (19:56 -0800)]
Introduce DatabaseLogEntry::newFromId
It's a helper function for when you need just one log entry.
Change-Id: Ic5e9db0def857d9dcecbd06bf081c8c83712c1ea
jenkins-bot [Mon, 5 Mar 2018 23:49:06 +0000 (23:49 +0000)]
Merge "resourceloader: Add test for non-empty user module in scripts-only queue"
jenkins-bot [Mon, 5 Mar 2018 23:42:38 +0000 (23:42 +0000)]
Merge "Update docs for AllowUserCssPrefs to not mention performance"
jenkins-bot [Mon, 5 Mar 2018 23:41:26 +0000 (23:41 +0000)]
Merge "DifferenceEngine: Use CSS classes instead of inline styles"
Timo Tijhof [Mon, 5 Mar 2018 22:41:29 +0000 (14:41 -0800)]
resourceloader: Add test for non-empty user module in scripts-only queue
The getData() tests did have a test case for a 'user' group module with
isKnownEmpty in the script-only queue, but not yet a non-empty one.
The makeLoad() tests did have both already. Arguably the makeLoad()
tests are higher level and observe its behaviour already (outputting
a script tag means 'loading', outputting nothing means 'ready'),
but adding it to the getData() tests for consistency.
Bug: T188689
Change-Id: I842febf996ba8bb0ea25b5ca3b5ac4503db87376
Brian Wolff [Fri, 23 Feb 2018 21:52:25 +0000 (21:52 +0000)]
SECURITY: Fix revdel checks in LogPager
Follow-up to
ce881e02e8d6 where the check for performer
restrictions and action restrictions was reversed.
Bug: T188145
Change-Id: I85a44f925212929ac87fb7a7e494023258f2d148
Timo Tijhof [Mon, 5 Mar 2018 22:15:44 +0000 (14:15 -0800)]
Update docs for AllowUserCssPrefs to not mention performance
* Before 2011, this was implemented as an inline stylesheet in OutputPage.
* In 2011, this was re-implemented through the 'user.cssprefs' module
(class: ResourceLoaderUserCSSPrefsModule) embedded in OutputPage.
* Between 2013 and 2016, all user-css preferences have either been
removed or migrarated to not need this module, eventually resulting
in the removal of that module in
2c688cfb11ea6c.
More details on T127328, but suffice it to say, it has no significant
performance concerns currently.
Change-Id: Ia89c4f91ecb67e3116989f2ea97c7ca69275a2fb
Translation updater bot [Mon, 5 Mar 2018 21:04:47 +0000 (22:04 +0100)]
Localisation updates from https://translatewiki.net.
Change-Id: I6aab8000374adfaa44c7f4ec3490969f58419f06
Petr Pchelko [Mon, 5 Mar 2018 19:44:11 +0000 (16:44 -0300)]
[JobQueueSecondTestQueue] Support read-only mode.
In order to switch non-idempotent jobs without losing the
backlog in redis we should support read-only mode in the queue,
where the messages only gets written into the new queue.
Change-Id: I2e9cb2d9cbbd2d657d042b55d4ea0819d21cdd6f
jenkins-bot [Mon, 5 Mar 2018 18:51:58 +0000 (18:51 +0000)]
Merge "Revert "Log the reason why revision->getContent() returns null""
jenkins-bot [Mon, 5 Mar 2018 18:33:47 +0000 (18:33 +0000)]
Merge "EditPage: In the list of "templates used", highlight redirect templates"
AdityaJ [Sat, 3 Mar 2018 08:25:17 +0000 (13:55 +0530)]
EditPage: In the list of "templates used", highlight redirect templates
Bug: T188737
Change-Id: I16af53c5048a95fd166f8e79ea26f164c1d3a49d
Bartosz Dziewoński [Mon, 5 Mar 2018 18:24:37 +0000 (19:24 +0100)]
DifferenceEngine: Use CSS classes instead of inline styles
Change-Id: Iee0e5e7eb73023a6f57c1f462e71cbb0e771d1f2
jenkins-bot [Mon, 5 Mar 2018 18:04:06 +0000 (18:04 +0000)]
Merge "StripState testing and cleanup"
jenkins-bot [Mon, 5 Mar 2018 18:02:30 +0000 (18:02 +0000)]
Merge "Limit total expansion size in StripState and improve limit handling"
Sbisson [Mon, 5 Mar 2018 15:17:46 +0000 (15:17 +0000)]
Revert "Log the reason why revision->getContent() returns null"
This reverts commit
8eb00f158422e5e2a9198f9d4318a1570b0f47af.
Change-Id: Id14fd26845349f8aca110ac1bad0598770122f25
jenkins-bot [Mon, 5 Mar 2018 11:59:33 +0000 (11:59 +0000)]
Merge "Fix master/replica race condition when creating null revisions"
Tim Starling [Wed, 28 Feb 2018 09:42:40 +0000 (20:42 +1100)]
StripState testing and cleanup
* Added StripState unit tests
* Deprecated unmaintained "half-parsed" serialization experiment
* Renamed some variables for brevity and removed unused "prefix"
Change-Id: I838d7ac7f9a2189e13d39c6939dba5d70e74a6b7
Tim Starling [Wed, 28 Feb 2018 02:11:56 +0000 (13:11 +1100)]
Limit total expansion size in StripState and improve limit handling
* Add a new limit to the parser which limits the size of the output
generated by StripState. The relevant bug shows exponential blowup in
output size.
* Remove the $prefix parameter from the StripState constructor. Used by
no Gerrit-hosted extensions, hard-deprecated since 1.26.
* Convert the existing unstrip recursion depth limit to a normal parser
limit with limit report row, warning and tracking category. Provide
the same features in the new limit.
* Add an optional $parser parameter to the StripState constructor so
that warnings and tracking categories can be added.
Bug: T187833
Change-Id: Ie5f6081177610dc7830de4a0a40705c0c8cb82f1
Fomafix [Sat, 3 Mar 2018 19:38:14 +0000 (20:38 +0100)]
mediawiki.special.apisandbox: Reorder functions
This avoids forward references and
/* eslint-disable no-use-before-define */
can removed.
Change-Id: If26a9c275665d20864687cd99d3679b362291fa9
Brad Jorsch [Sun, 4 Mar 2018 04:31:02 +0000 (23:31 -0500)]
ApiQueryContributors: Use correct variable
Bug: T188813
Change-Id: Ibc705d61d57cfe8867d1bde35781515c25b777c1
Aaron Schulz [Fri, 2 Mar 2018 10:11:35 +0000 (02:11 -0800)]
rdbms: cleanup some type checks and documentation
This clears up some IDEA warnings for database classes
Change-Id: Ic6f3812b012c1791986d24723b757daf4e151e45
jenkins-bot [Sat, 3 Mar 2018 23:06:23 +0000 (23:06 +0000)]
Merge "Drop 'comma' value for wgArticleCountMethod"
Translation updater bot [Sat, 3 Mar 2018 20:59:53 +0000 (21:59 +0100)]
Localisation updates from https://translatewiki.net.
Change-Id: I12d8afdf599386fa27fd3f9ff96f77e16ef9a560
Eddie Greiner-Petter [Sat, 3 Mar 2018 15:26:39 +0000 (15:26 +0000)]
purgeExpiredUserrights: Show number of rows purged
Show the number of rows purged when running
maintenance/purgeExpiredUserrights.php
Bug: T176754
Change-Id: I091042baef8982c108b17126cde4998fc9a0cd6d
Roan Kattouw [Sat, 3 Mar 2018 03:54:45 +0000 (19:54 -0800)]
Fix master/replica race condition when creating null revisions
RevisionStore::newFromNullRevision() carefully reads the latest revision
from the master, but then forgets to instruct emulateMainSlot_1_29() to
do the same, so the lookup query for rev_text_id in the text table is
done against a replica.
This is not usually a problem for null revisions, but it is a problem
when editing a page and then immediately moving it: this causes a null
revision to be created based on a freshly created revision, which
doesn't yet exist on the replica.
Bug: T184670
Change-Id: Ied4db5ee770716ff3edb918d2be722934c79d0c7
Kunal Mehta [Fri, 9 Feb 2018 20:10:07 +0000 (12:10 -0800)]
Use RemexHtml as the tidy implementation for parser tests
* RemexHtml is the future of "tidy" in MediaWiki,
so run our parser tests using it.
* This is a necessary step before we can make it
the default in MediaWiki (T185753).
* Cleaned up a bunch of tests:
(a) where html/php+tidy and html/parsoid match up,
retained a html+tidy section and removed the others.
(b) where html/php and html/php+tidy match up,
retained the html/php section and removed the
html/php+tidy section.
* Annotating tests with explanations where Parsoid & Remex
output differ. This is usually because of two reasons:
(a) Parsoid has Tidy-emulation code in some cases (which
we can consider stripping away separately).
(b) Parsoid does a bunch of cleanup on the DOM (which was
probably done to emulate Tidy output, but which could
probably be retained). Since Parsoid (in some form)
will be default parser in the future, no reason to try
to port this cleanup (in broken markup scenarios) into
Remex.
* Left a bunch of FIXMEs for later followup.
Unrelated cleanup:
* Renamed a few tests since the functionality in Parsoid
was fixed up. There is no more "implicit <td>" support.
Those all now lead to fostered content.
* Fixed some clearly broken output in html/parsoid sections
for some tests.
Co-Authored-by: Kunal Mehta <legoktm@member.fsf.org>
Co-Authored-by: Subramanya Sastry <ssastry@wikimedia.org>
Bug: T188167
Depends-On: I646dbabb3c2ed28c1ea72c5bd8f7f92d03f57c75
Change-Id: Ic7c34d57a300dbd36a37f03fbfe33391b2950b44
Translation updater bot [Fri, 2 Mar 2018 21:01:20 +0000 (22:01 +0100)]
Localisation updates from https://translatewiki.net.
Change-Id: I29741ea3f2e69c74456584857b144f2cdb7465f9
jenkins-bot [Fri, 2 Mar 2018 20:38:59 +0000 (20:38 +0000)]
Merge "Introduce hasSlot in RevisionRecord and RevisionSlots."
addshore [Tue, 16 Jan 2018 13:53:22 +0000 (13:53 +0000)]
[MCR] NameTableStore
General purpose cached store for things like:
- content_models (id,name)
- slot_roles (id,name)
And in the future possibly namespaces & content_formats
as mentioned at:
https://www.mediawiki.org/wiki/Multi-Content_Revisions/Schema_Migration#Name_tables
Bug: T188518
Change-Id: Ia550ef7fe30af25ac3fee5ac8a89d032544563bf
jenkins-bot [Fri, 2 Mar 2018 19:26:49 +0000 (19:26 +0000)]
Merge "rdbms: make LoadBalancer::getConnection() ignore CONN_TRX_AUTO when unusable"
jenkins-bot [Fri, 2 Mar 2018 19:13:58 +0000 (19:13 +0000)]
Merge "rdbms: avoid strange uses of empty()"
jenkins-bot [Fri, 2 Mar 2018 19:10:28 +0000 (19:10 +0000)]
Merge "rdbms: add missing hint check DatabaseMysqlBase::isInsertSelectSafe"
jenkins-bot [Fri, 2 Mar 2018 18:55:37 +0000 (18:55 +0000)]
Merge "Ensure abort link parsing on xmlish tag in link title position"
Aaron Schulz [Wed, 28 Feb 2018 00:00:05 +0000 (16:00 -0800)]
rdbms: make LoadBalancer::getConnection() ignore CONN_TRX_AUTO when unusable
Change-Id: I1fd13171c3cfbe071e8e398d561281188d998767
jenkins-bot [Fri, 2 Mar 2018 16:36:26 +0000 (16:36 +0000)]
Merge "Fix undefined $ok in DatabaseUpdater::migrateComments"
Reedy [Fri, 2 Mar 2018 16:24:50 +0000 (16:24 +0000)]
Fix undefined $ok in DatabaseUpdater::migrateComments
Change-Id: I608a693e688039526975ef5d3fe4c40c7679ed7b
jenkins-bot [Fri, 2 Mar 2018 11:10:08 +0000 (11:10 +0000)]
Merge "User: Remove ::setCookie/etc., deprecated in 1.27"
jenkins-bot [Fri, 2 Mar 2018 11:03:59 +0000 (11:03 +0000)]
Merge "EditPage: Remove methods from OOUI transition, deprecated in 1.30"
jenkins-bot [Fri, 2 Mar 2018 11:01:07 +0000 (11:01 +0000)]
Merge "resourceloader: Un-deprecate makeLoaderConditionalScript()"
James D. Forrester [Tue, 27 Feb 2018 23:55:34 +0000 (15:55 -0800)]
User: Remove ::setCookie/etc., deprecated in 1.27
Change-Id: I6b37ffd957cdeba79037dadd36f50e0a0b89e5f5
James D. Forrester [Tue, 27 Feb 2018 23:34:49 +0000 (15:34 -0800)]
EditPage: Remove methods from OOUI transition, deprecated in 1.30
No uses found in code search.
Change-Id: I683538f72eab3002ebb4b3e0c76a1ffa6fb9e39a
daniel [Tue, 27 Feb 2018 18:08:47 +0000 (19:08 +0100)]
rdbms: in Database::selectSQLText, do not treat $conds = "0" as no condition
This fixes an issue that arises because empty( "0" ) is true in PHP.
The new behavior rejects any conditions that are not strings or arrays,
and lets $conds = "0" be passed to the databases as WHERE 0.
Some databases may reject this as invalid syntax, which is the expected
behavior here, instead of silently ignoring the 0, causing no condition to
be applied to the query.
Bug: T188314
Change-Id: I5bc4d7f41221a886c85e54d9da67c4c095a7d9ce
Aaron Schulz [Fri, 2 Mar 2018 04:41:32 +0000 (20:41 -0800)]
rdbms: add missing hint check DatabaseMysqlBase::isInsertSelectSafe
This was lost when a bunch of other logic was split off in
671368a59e3
Change-Id: I3d3f744f8fce007ecf88cbd2c9f99918b06f0573
Aaron Schulz [Fri, 2 Mar 2018 04:30:07 +0000 (20:30 -0800)]
rdbms: avoid strange uses of empty()
Change-Id: Id1a8d1aae72cdee48e43ddb3227cd697516411e0
jenkins-bot [Fri, 2 Mar 2018 03:59:40 +0000 (03:59 +0000)]
Merge "Expose the latest modified index seen by EtcdConfig"
jenkins-bot [Fri, 2 Mar 2018 02:50:32 +0000 (02:50 +0000)]
Merge "rdbms: make Database::insertSelect() stricter about replication safety"
Aaron Schulz [Wed, 28 Feb 2018 23:33:03 +0000 (15:33 -0800)]
rdbms: make Database::insertSelect() stricter about replication safety
Avoid the native INSERT SELECT method if a LIMIT clause is present.
Change-Id: Ibf9b8a4a42092fbc98d7ebd45167203a6a8801ee
daniel [Tue, 27 Feb 2018 18:37:26 +0000 (19:37 +0100)]
Pass '' instead of false for the $conds parameter in select calls.
Per documentation on IDatabase, $conds must be a string or an array.
Passing false for conds is confusing, since it's unclear whether this
should match everything or nothing.
Bug: T188314
Change-Id: I8be1ac4cbdaafc41aadc2a658be8a99b754b0268
Timo Tijhof [Fri, 2 Mar 2018 01:12:03 +0000 (17:12 -0800)]
resourceloader: Un-deprecate makeLoaderConditionalScript()
It was deprecated to encourage callers to use makeInlineScript()
instead, because before makeInlineScript() was introduced, callers
would often manually wrap it in a <script> tag, which we don't want
because 1) We want de-duplication through WrappedString and 2)
callers sometimes forget to use Html.php methods that ensure
proper escaping as-needed.
However, there is still use in getting thet wrapped script without
also the wrapped HTML script tag. Namely, for use in http responses
that produce JavaScript, rather than HTML, where there cannot be
an HTML script tag.
There is at least one such caller (in SpecialJavaScriptTest) and
it's fine for there to be others.
Change-Id: Icfc285e12293c76dc68a220deb6816e32b058209
James D. Forrester [Tue, 27 Feb 2018 23:24:03 +0000 (15:24 -0800)]
Follow-up
6d4e1547: Hard-deprecate these functions
Only use in Wikimedia production is in GlobalCssJs, below.
Depends-On: I7543fe9ea393901379c16c4f0b1e96fa20955b6f
Change-Id: I66292b179d948e46dba3513f50c3d36012765a9d
James D. Forrester [Wed, 28 Feb 2018 01:45:27 +0000 (17:45 -0800)]
Drop 'comma' value for wgArticleCountMethod
We have three methods for page counting currently supported for wikitext
non-redirect pages; 'any' counts any page that exists, 'link' counts any
page that has any outbound links, and 'comma' which searches for any ','
in the text having loaded it. This last option is much slower than these
other two, and is only used on a very small number of installations. Now
by dropping support for this method we can simplify this code and so run
it more often. Note that non-wikitext pages already did not support this
count method.
Installations with this setting set to 'comma', or any other string will
now work as if it was configured with 'any'.
Bug: T188472
Change-Id: I965927edcd2485ec4b49b2d80fdf216dbf19520b
Aaron Schulz [Wed, 28 Feb 2018 22:41:18 +0000 (14:41 -0800)]
rdbms: make replace()/upsert() use atomic sections
This makes them consistent with nonNativeInsertSelect()
Style aside, there is also the potential edge case of:
a) no transaction being active yet, with
b) the first query being replace() or upsert(), with
c) DBO_TRX being set (usually part of an implicit transaction round)
Previously, in that case, these methods would commit the transaction
they started, rather than leave it open. The correct semantics are
to leave it open. Since MySQL redefined upsert() to use ON DUPLICATE
KEY UPDATE, it already had the right behavior.
Also make sure that rollback() always sets the affectedRowCount
field to 0.
Change-Id: I15f923d3d4799cffc60e3aaea934f4ca1a9488e1