Commit graph

84 commits

Author SHA1 Message Date
Sumit Asthana d83ac976e3 TextExtracts allow sentence end with numbers
Allows sentences to end with numbers before a full stop in query
extractsentences.

Also added some more unit tests.

Bug: T118621
Change-Id: I9cbf487601d4165b490696d38d5fcbcf6d8f4637
2015-11-18 20:11:20 -06:00
Kunal Mehta 36d1b4f3c4 Use page_touched in cache key instead of page_latest
Because the extracts depend upon template inclusion, to make sure
the extract is properly updated whenever the page's dependencies change,
use the page_touched timestamp instead of the latest revision id.

Since we're changing the cache key format, remove the 'mf' prefix from
back when it was still in MobileFrontend.

As a side-effect, this will also make action=purge invalidate the cache
since it updates page_touched.

Bug: T117322
Change-Id: Ib6f415c756c57caf6c83be495a4f229446e8b61e
2015-10-31 22:00:51 -07:00
Kunal Mehta 29ae8b5a63 build: Updating development dependencies
* grunt-banana-checker: 0.2.2 → 0.4.0

Change-Id: Ie92e204df31ddfbcf5a730e4f20b823dc62f9451
2015-10-11 12:02:31 -04:00
Translation updater bot 1619d0ed93 Localisation updates from https://translatewiki.net.
Change-Id: I1f493a5960eb10432200066a43725ebc248dc211
2015-08-25 21:58:44 +02:00
Translation updater bot abe8497359 Localisation updates from https://translatewiki.net.
Change-Id: I43956927ad3770fee9c243bf19be599121b6b5a6
2015-08-17 21:13:55 +02:00
Translation updater bot 8e4d9b1e57 Localisation updates from https://translatewiki.net.
Change-Id: I8305f1ccf12e5e830cd23540a4418018afdb5ff2
2015-08-04 23:17:45 +02:00
Matthew Flaschen 63b358fca2 SECURITY: Disallow extracts for non-wikitext for now.
Note that the sensitive information is still in the TextExtracts
memcached, so this requires security review (and either eviction
or a cache key change) before enabling other content models.

Bug: T107170
Change-Id: I57642e84db39d585c5b04453f86102b10fb69cdf
(cherry picked from commit f5c114c571)
2015-08-04 00:08:43 +00:00
Translation updater bot 13e609f894 Localisation updates from https://translatewiki.net.
Change-Id: I1549511a0359c0d0bdace51652f55daa788f8118
2015-07-29 21:51:42 +02:00
Translation updater bot 528f071006 Localisation updates from https://translatewiki.net.
Change-Id: I07bf82c80c5d9e7bb839b5fb6e30916c4722e045
2015-07-26 21:41:55 +02:00
Translation updater bot 68f8894208 Localisation updates from https://translatewiki.net.
Change-Id: I8065e2f2c1b4afdf824498691c7820174be796a0
2015-07-25 21:58:17 +02:00
jenkins-bot 0285c9e033 Merge "Ensure sentences is an int" 2015-07-15 20:35:34 +00:00
Ori Livneh 7c1ea48971 Update for rename of WikiPage::isParserCacheUsed() in I7de67937f0
Make the code compatible with both the old name (WikiPage::isParserCacheUsed)
and new name (WikiPage::shouldCheckParserCache).

Change-Id: If5d5da8eab132eb6d60f7141884ed2aeaa46e444
2015-06-22 20:44:23 -07:00
Kunal Mehta 9a27b49107 build: Configure banana-checker and jsonlint
Change-Id: I89b3081c9aa7ae89e8a38f0c339f7a2a091278c9
2015-06-19 22:28:08 -07:00
Translation updater bot 56babdb243 Localisation updates from https://translatewiki.net.
Change-Id: I5a5ffeca3155d5a7d32baedae831d622ad55d0f4
2015-06-09 22:51:24 +02:00
Translation updater bot 0855984b0a Localisation updates from https://translatewiki.net.
Change-Id: I021a014f58a2fc30ea37defe0b1540b85c105d1b
2015-06-05 21:14:00 +02:00
Translation updater bot 8c2392dc85 Localisation updates from https://translatewiki.net.
Change-Id: I72270682f0be9e9bbcb6cdac6ccebe6372dc7cd7
2015-06-02 21:49:02 +02:00
Translation updater bot b2e9acf604 Localisation updates from https://translatewiki.net.
Change-Id: I2676f5b2882c189cc46767e41b00c4e6f7fffb68
2015-05-25 22:38:42 +02:00
Translation updater bot dd42a1e453 Localisation updates from https://translatewiki.net.
Change-Id: I155f9b19a797ca31ad5b3e3791ef78749f58b837
2015-05-24 00:17:10 +02:00
Translation updater bot 27640d1f63 Localisation updates from https://translatewiki.net.
Change-Id: I6e0069c01cac2884116a08d81171021a8195f253
2015-05-21 23:02:12 +02:00
Translation updater bot 46f6a992fa Localisation updates from https://translatewiki.net.
Change-Id: Ie3313242aa73e12c9ef74ea97e31926b88626b20
2015-05-11 21:52:20 +02:00
Translation updater bot 817edafe63 Localisation updates from https://translatewiki.net.
Change-Id: I0755b809f65657607fc97f833ccebff0ae0ea626
2015-05-09 21:53:19 +02:00
Translation updater bot ed1cc3401a Localisation updates from https://translatewiki.net.
Change-Id: I6aa92864200da35ab482abc6745704e0663a5989
2015-04-29 22:37:56 +02:00
Brad Jorsch 95002e7a59 Further cleanup for core API change
PS25 and later changed things around a fair bit, meaning the previous update
needs some further updating. In some cases additional cleanup is also necessary
for future core API changes.

Bug: T96595
Change-Id: I1573e523cf3c945fca95d8d2db002f5abcdbb29d
2015-04-20 14:41:29 -04:00
csteipp 97495d1ff3 Ensure sentences is an int
In the spirit of escaping as close to the output as possible, ensure
that the number of sentences is an integer before using it in a regex.
Just in case someone changes the api's param definition.

Change-Id: I406d6ed365ecd53bd8f56a09218a7e1403fe0fa9
2015-03-24 12:54:54 -07:00
Translation updater bot 6d16af29ee Localisation updates from https://translatewiki.net.
Change-Id: I455e4a1d0a16e4654ed679253ef46273dfec3744
2015-03-10 22:37:12 +01:00
Brad Jorsch c3eb02a9a6 Update ApiResult handling for mediawiki/core change I7b37295e
Change I7b37295e for mediawiki/core deprecates several methods, and more
importantly changes the format of the data returned from
ApiResult::getData(). This change should handle these differences in a
backwards-compatible manner.

Change-Id: I7b37295e8862b188d1f3b0cd07f66ac34629678e
2015-02-17 14:37:22 -05:00
Chad Horohoe d9869ef8d0 Remove obvious function-level profiling
Change-Id: I0c272eb337566eff28d46d198c9aa065ffdbddb2
2015-02-11 08:49:13 -08:00
jenkins-bot 1c58fd6df9 Merge "Don't flatten spans" 2015-01-13 20:40:04 +00:00
Sam Smith 59633e2be9 Don't flatten spans
... so that per-span information for different languages, i.e. lang and
dir attributes aren't lost.

Bug: T59582
Change-Id: If1b04714fdc0f4d581ddb858d8d53f6f340dc10b
2015-01-13 16:31:01 +00:00
Ori Livneh 23dcce746a MWException -> Exception
Change-Id: If111014ef2d7aea5c72bdcf4600a9067e2e21e00
2015-01-09 19:06:21 -08:00
Translation updater bot b4ccbab8a4 Localisation updates from https://translatewiki.net.
Change-Id: I9e763837fc34a26ec1c598cd627b5c1fc425d987
2015-01-08 22:47:25 +01:00
Translation updater bot a699afc932 Localisation updates from https://translatewiki.net.
Change-Id: I2a65c45c51514f3b317887431a586800c2b5f0ff
2015-01-06 22:28:39 +01:00
Max Semenik fbd8e93a8b Reorg: move hooks to a separate class, introduce namespaces
Change-Id: Ic784010e79b1168f0e112cf912f463036255eb64
2014-12-31 15:05:19 -08:00
Ricordisamoa c689444302 Use defined() instead of constant()
To check for the existance of ApiBase::PARAM_HELP_MSG
while preventing warnings from being issued:
http://php.net/manual/en/function.constant.php#refsect1-function.constant-errors
https://www.mediawiki.org/wiki/Thread:Extension_talk:TextExtracts/PHp_Warnings_in_version_1.24

Fixes commit 9207edfa81

Change-Id: Iceaf4e424cd929df7b3df46544844a4b0001f4d7
2014-12-22 20:41:13 +01:00
Translation updater bot 16203b2374 Localisation updates from https://translatewiki.net.
Change-Id: I5b7d64c29a229c77fc26c5408a0f0904167241b0
2014-12-18 23:23:04 +01:00
Nik Everett 24308948ed Retry parse call if it fails to get section
Some pages don't support extracting sections.  If the parse FauxRequest
fails then try again without the request to get a section.

Bug T78721

Change-Id: I37320208af38ea39e80b292b009bbaa7ab6d1c96
2014-12-17 10:07:56 -05:00
Translation updater bot 6b5cda9c11 Localisation updates from https://translatewiki.net.
Change-Id: I88cca2920ee73f07f3a3441f9c348bb4111fd240
2014-12-08 23:24:11 +01:00
jenkins-bot 3085f40a5d Merge "Use new ApiOpenSearchSuggest hook" 2014-11-27 05:14:28 +00:00
Translation updater bot adbd66735a Localisation updates from https://translatewiki.net.
Change-Id: I948878505b29d71684343f4bd2acf31b0d7ee71b
2014-11-10 22:11:58 +01:00
Translation updater bot 18cbf536cb Localisation updates from https://translatewiki.net.
Change-Id: I36aa7bc2141bea28ac532c71733c9f10eb6ff371
2014-11-09 21:54:20 +01:00
Brad Jorsch d539c1aed8 ApiQueryExtracts: Call setWarning() on $this, not $result
Calling it on $result results in the warning looking like it's coming
from the 'result' module rather than 'textextracts'.

Change-Id: I396409c5e1d09385d9b564ca8cf854c899bb1ba4
2014-11-07 15:32:49 -05:00
Brad Jorsch 781fef39c1 Use new ApiOpenSearchSuggest hook
With Ie0ab9090, the OpenSearchXml extension is merged into core. The new
hook works identically to OpenSearchXml's hook.

The $wgExtractsExtendOpenSearchXml variable should probably be renamed,
but I'm leaving that for a different patch.

Change-Id: I16024aa22578585873cddba1daa4ca0dc05645e1
2014-11-05 17:22:18 -05:00
Brad Jorsch 9207edfa81 Add i18n for API module help
MediaWiki core change I04b1a384 added support for i18n of API module
help. This takes advantage of that while still maintaining backwards
compatibility with earlier versions of MediaWiki.

Once support for MediaWiki before 1.25 is dropped, the methods marked
deprecated in this patch may be removed.

Change-Id: I67395aff48185f3e09da31b51a08aa2541fe6a17
2014-10-29 16:37:38 -04:00
jenkins-bot f18baebe98 Merge "Use Config instead of globals" 2014-09-03 21:19:23 +00:00
addshore e8d04b46da Remove use of deprecated getPossibleErrors (since 1.24)
Change-Id: I1401a832fda82b28fa2a942460b61428ec96d570
2014-08-29 12:17:11 +01:00
Kunal Mehta bad296f489 Use Config instead of globals
Converts the API module to use new factory function introduced
in Ieb8549, allowing for proper dependency injection of a Config
instance.

Change-Id: I78cdb5098a6c816f84b3efffeaadf789ca822df7
2014-08-12 23:18:34 -07:00
Max Semenik 484b27ba81 Add variant to cache key
Bug: 66621
Change-Id: I8d80dbbb35fa720a778fbf2b6a0248e141900522
2014-06-24 14:00:59 -07:00
Translation updater bot 18f7117350 Localisation updates from https://translatewiki.net.
Change-Id: I78cab3022a4a04286d66dcaf13efee39fbe56844
2014-05-28 19:35:25 +00:00
Waldir Pimenta edc9fbe08b add .noprint and ul.gallery to ignored elements
Change-Id: I6bb782d45853bb9e0682a4ab25556b3de70addce
2014-05-11 03:20:51 +02:00
jenkins-bot a316a72e24 Merge "Unclusterfuck per-char and -sentence trimming from ApiQueryExtracts" 2014-05-02 01:07:40 +00:00