Commit graph

698 commits

Author SHA1 Message Date
Jackmcbarn 2295009729 Add 2 tests to unitTestsList
Change-Id: I839515927e66a046d7b3e7b00d7d24efad3eacb5
2014-08-09 21:34:12 -04:00
Brad Jorsch 0367e9bddd Fix deceptively-simple pattern in pure-Lua ustring
The pure-Lua ustring pattern matching functions short-circuit to the
much faster string library when the pattern would match the same against
the raw bytes.

A pattern like "[^a-z]" can match a partial UTF-8 character when applied
bytewise, and so must be detected as unsafe.

Let's also directly test the pure-Lua module, instead of me having to
comment out lines in Scribunto_LuaUstringLibrary::register() whenever I
want to test them.

Change-Id: I91ed3374aadfea379b9db2e13b4248ab20df509e
2014-08-10 01:18:18 +00:00
Translation updater bot 40985a1672 Localisation updates from https://translatewiki.net.
Change-Id: I11744269b591364bae9005acdae6982c2c50b4db
2014-08-09 20:01:48 +02:00
Translation updater bot 9a0d54f188 Localisation updates from https://translatewiki.net.
Change-Id: I7378f7769ace0fe0fb6ee48843def3cec63936a8
2014-08-03 22:11:17 +02:00
Translation updater bot a19e02e708 Localisation updates from https://translatewiki.net.
Change-Id: Icd13be7bd474b6335fc827f0776b629891b2bc1c
2014-07-31 22:17:08 +02:00
Translation updater bot 82ded32899 Localisation updates from https://translatewiki.net.
Change-Id: I8ce19edb53277a92fcb3a87e21815587bd50dfdd
2014-07-29 21:56:35 +02:00
Translation updater bot 1677aec38e Localisation updates from https://translatewiki.net.
Change-Id: I1a021ae3c2d80d9b121008b46dd7fc222fedd5ef
2014-07-27 22:23:06 +02:00
Translation updater bot 46d36fa9e7 Localisation updates from https://translatewiki.net.
Change-Id: I2a3226f1ee04db59a38e62da1567a0ae633a4c4e
2014-07-21 21:41:30 +02:00
Translation updater bot a43536721d Localisation updates from https://translatewiki.net.
Change-Id: I541c910a90969b00b10d9ac7706a4139a519a25f
2014-07-19 22:06:18 +02:00
Translation updater bot d5e3ee8b25 Localisation updates from https://translatewiki.net.
Change-Id: I80b9acfcb6e570818b5e99114b62cbd522bc6e11
2014-07-17 22:59:53 +02:00
Translation updater bot bf06e53085 Localisation updates from https://translatewiki.net.
Change-Id: I56772871ae4f19deec821009eac5fe5caf099101
2014-07-14 22:02:12 +02:00
jenkins-bot 160770ae3e Merge "Simplify mw.text.listToText" 2014-07-14 17:08:29 +00:00
Mr. Stradivarius 1d13fd503a Simplify mw.text.listToText
Simplify the logic in mw.text.listToText so that we don't need to add or
remove anything from the original table we were passed.

Change-Id: I3efcbba1b9adc9a9e32e366e355cb742376cd91b
2014-07-14 19:32:33 +09:00
Translation updater bot 71a7260c77 Localisation updates from https://translatewiki.net.
Change-Id: If158dbcba0abc103d0b706762ff15d581a612210
2014-07-13 22:24:11 +02:00
Translation updater bot 5cb6eb1215 Localisation updates from https://translatewiki.net.
Change-Id: If2be054e4eb1c36bba7922b12b08e01e121e2aff
2014-07-11 21:57:26 +02:00
jenkins-bot ef40ccc8b1 Merge "Fix wrong variable in ustring.lua" 2014-07-11 17:50:03 +00:00
Jackmcbarn ee289c8045 Make the cssEncode pattern simpler
The pattern used by cssEncode is unnecessarily complicated. Simplify it by
using a negating pattern.

Change-Id: I5dc7169efea63473e9e23a1450d2941e434a00d8
2014-07-11 11:40:57 -04:00
Brad Jorsch cb2a331565 Fix wrong variable in ustring.lua
Change-Id: Ibc8056b36d615b57d357987c59219a22e63fdfe8
2014-07-11 11:25:35 -04:00
Translation updater bot bfb0c1c091 Localisation updates from https://translatewiki.net.
Change-Id: Ia57586653adf7ba67f5ddeb96ae9c68b70ded475
2014-07-09 20:35:42 +00:00
jenkins-bot e9b34e7ec8 Merge "Create mw.dumpObject split from mw.logObject" 2014-07-09 15:34:38 +00:00
Jackmcbarn 58a0db1121 Make logs work in preview on OSs other than Linux
$this->initialStatus is only set on Linux, so don't require it to output
log entries.

Change-Id: I3000718026691398f79714e691a094c0792cd342
2014-07-09 11:02:51 -04:00
Jackmcbarn 7c51f69901 Create mw.dumpObject split from mw.logObject
Add an mw.dumpObject() method, which converts an object in the same manner
as mw.logObject(), but returns it instead of adding it to the log buffer.

Change-Id: Ie9fbd24d9d8d13ee2ddf8052679010892f61e1e0
2014-07-09 10:30:53 -04:00
jenkins-bot 979e581d34 Merge "Expose mw.log data on preview" 2014-07-09 00:43:57 +00:00
Translation updater bot d26b066a39 Localisation updates from https://translatewiki.net.
Change-Id: I86981563430a217701733e75b100815ef87c987e
2014-07-07 20:21:06 +00:00
Brad Jorsch 410229c312 Expose mw.log data on preview
People have been complaining that they can't find the log data anywhere.
The new parser limit report seems a good place to show this information.

Change-Id: If2abf27f7779d92ff7c7a1f32b2a54a5de521678
2014-07-07 16:14:30 -04:00
Jackmcbarn 40b8bd2caa Add comments and remove trailing whitespace
Clean up trailing whitespace from all of our code, and add comments
indicating that apparently unused variables are ScopedCallbacks.

Change-Id: I8e5997797cc7b1c64c5351ec112a18f30edc8fef
2014-07-07 14:46:59 -04:00
jenkins-bot 830f7adafa Merge "Improve mw.getCurrentFrame handling" 2014-07-07 18:26:47 +00:00
jenkins-bot d0960c7179 Merge "Update GeSHi integration" 2014-07-07 17:35:02 +00:00
Brad Jorsch 85aca87e94 Improve mw.getCurrentFrame handling
Two similar bugs are handled here:
* mw.getCurrentFrame() doesn't work when the module is loaded (only when
  a function is called), which breaks os.date and os.time at module
  scope since I59ad364d.
* mw.getCurrentFrame() gives access to frame args from inside
  mw.loadData, which allows for data leakage between #invokes.

Bug: 67498
Bug: 65687
Change-Id: I82dde43e2601b59c03c6ed4b9365829c40a953a5
2014-07-07 13:11:20 -04:00
Translation updater bot 2f4b3c28ad Localisation updates from https://translatewiki.net.
Change-Id: I98c2938bf8d8afa5a7e9a0e1fd33e64b4bc276ed
2014-07-03 19:21:15 +00:00
Brad Jorsch c44d576b78 Update GeSHi integration
Idf4ad439 deprecated SyntaxHighlight_GeSHi::buildHeadItem in favor of
ResourceLoader. We may as well follow along.

To avoid breaking things if people don't update their
SyntaxHighlight_GeSHi in sync with Scribunto, test for the RL class used
in GeSHi's ResourceLoader integration and continue using buildHeadItem
if it's not found.

Change-Id: Id93530dce7c8c5a70a98fca58844adf9b5c6a23f
2014-07-03 14:50:50 -04:00
jenkins-bot 8a8a268066 Merge "Allow for skipping Lua tests" 2014-07-01 18:45:58 +00:00
Brad Jorsch ebc737db91 Fix whitespace in i18n/en.json
Change-Id: I6f250deb1873d0b805cf941b9d67c9850fd6eb9c
2014-07-01 11:43:26 -04:00
Brad Jorsch 631feb8a3d Allow for skipping Lua tests
From the PHP subclass of Scribunto_LuaEngineTestBase, Lua tests run by
Scribunto_LuaEngineTestBase::testLua() may be skipped by adding an entry
for the test name to $this->skipTests.

From the Lua code run by Scribunto_LuaEngineTestBase::testLua(), tests
may be skipped by calling the "markTestSkipped" function exported by the
TestFramework module.

Also, use this new mechanism to skip certain mw.language tests if
Extension:CLDR or a similar extension is not available.

Bug: 67343
Change-Id: I4f0b15073a84bf2f9d8a5d905c3c960941dd2b71
2014-07-01 10:48:36 -04:00
Jackmcbarn e65638777a Show blanknamespace in content language
This is cached with the page.

Change-Id: I62335dd37c411dc5dc77ac7564c6fa6361679ac3
2014-06-30 11:44:47 -04:00
Jackmcbarn ec42679913 Show ScribuntoExceptions in content language
Messages from ScribuntoException are cached and stored with the page, so
they need to be output in the content language.

Change-Id: Ic8bd5cef2c49118ccb258592ca515c0e71f210e3
2014-06-28 17:59:05 -04:00
Jackmcbarn 8d1d5ac84c Fix strange mw.html errors with numeric arguments
Some functions in mw.html accept numbers as arguments, but later fail when
constructing the string. This disallows numbers in attribute names, since
they aren't valid anyway, and fixes the remainder of the cases to properly
build the string.

Bug: 67201
Change-Id: Ie7bcbb9d8df580dd8793681f78a8b0719d8a287a
2014-06-27 14:41:42 -04:00
Brad Jorsch bf39827980 mw.ustring functions should accept numbers where string functions do
Lua's string functions tend to auto-convert numbers to strings. We
should do the same in mw.ustring.

Bug: 67201
Change-Id: Icd3c5e93bac19dafd78d737ec9b315daba9f1729
2014-06-27 12:31:04 -04:00
Brad Jorsch ccab415701 Don't cache volatile wikitext
Certain wikitext, such as that containing Cite.php <ref> or <references>
or the #tag versions of the same, should not be cached. This uses the
isVolatile method added to PPFrame in I95b3cf87 to avoid caching the
preprocessed output of such wikitext from frame:preprocess and similar
methods.

Bug: 46815
Change-Id: I1084f87fd863eb22f2f3f3d3ff308b24e20a08ef
2014-06-26 22:03:35 -04:00
Jackmcbarn 780d8e1ec7 Set TTLs on outputs containing times
When os.date, os.time, or mw.language:formatDate are called, set the
appropriate TTL on the output. This needs I412febf3 in core to function at
all, and I3f5a80aa in core to function with formatDate.

Change-Id: I59ad364d502fc247500d94c5606516ad9f98a24d
2014-06-23 15:52:17 +00:00
Translation updater bot 34ff6f5683 Localisation updates from https://translatewiki.net.
Change-Id: I458eb93b21a0ade3cc06224bb48fde3117f80f68
2014-06-22 19:31:10 +00:00
Translation updater bot 192ab4faff Localisation updates from https://translatewiki.net.
Change-Id: I4ac01d0a68bf239d30d762f3d6e96b5bd42f6dc4
2014-06-20 19:51:03 +00:00
jenkins-bot 996a48e42c Merge "Remove dead code" 2014-06-19 18:45:14 +00:00
jenkins-bot 8d7d5f35ed Merge "Allow passing nils to mw.html" 2014-06-19 16:57:02 +00:00
Jackmcbarn d1030989bc Allow passing nils to mw.html
Rather than calling error() when nils get passed to mw.html methods,
either remove whatever it was that the nil would go to (if that makes
sense), or just do nothing. The seemingly inconsistent use of "not x" and
"x ~= nil" is to allow any falsey value where it wouldn't be ambiguous
(such as class names), but not where it could be (such as attribute values).

Bug: 62982
Change-Id: I76773abbb4394aa9bb8c8a08445e019cade3b2bf
2014-06-19 11:40:39 -04:00
Marius Hoch 9e6b67c723 Remove dead code
Just confusing...

Change-Id: I8b6e3d290c8ae75159e86835a0d359a4dcaa7a0e
2014-06-18 19:56:39 +02:00
Reedy 4d0665dbd8 Parameter type hints
Change-Id: I3d578ab6fb65917ef0fa65767089b01ca7c4e96d
2014-06-18 18:19:07 +01:00
Marius Hoch 186212cfe6 Fix return doc for ScribuntoEngineBase::fetchModuleFromParser
Change-Id: I5c16c18ee4667adcb76fd647f55713ef227466e8
2014-06-18 18:51:09 +02:00
Brad Jorsch ec7472a0e5 Sanity check $wgNamespaceAliases
If someone goes and adds aliases for namespaces that don't actually
exist (as was done in I94c34799, for example), Scribunto will run into
issues when trying to create its mw.site.namespace objects.

Let's ignore those bogus aliases so we don't go breaking everything just
because someone did something stupid.

Change-Id: I16acd97f587de320cf61becb829cc66794cbb119
2014-06-17 14:23:26 -04:00
Translation updater bot ee21d14c4a Localisation updates from https://translatewiki.net.
Change-Id: I9dca99dcce20918d3a9fa9fe4a24f6f2a3552634
2014-06-12 21:38:57 +00:00