Commit graph

2008 commits

Author SHA1 Message Date
Brad Jorsch d9ba200571 Add mw.logObject
People have requested a method to log a table as something more detailed
than just "table", to be able to inspect values while debugging.

Bug: 48173
Change-Id: Ia58cab834e87842927a2a13d153ee32473f74086
2013-07-26 05:15:20 +00:00
Translation updater bot 9824143a82 Localisation updates from http://translatewiki.net.
Change-Id: I7cd3d18df96652eb43b9e3ad61c848e5565cceaf
2013-07-25 19:30:50 +00:00
Mark A. Hershberger e08b2a4524 Update ignores for some emacs tmp files
Change-Id: I7ea67b68e701f6b9ef6685d10988af347798cb67
2013-07-25 13:11:50 -04:00
jenkins-bot 3e2972394f Merge "Improve disable_functions handling in LuaStandalone" 2013-07-24 20:16:17 +00:00
Translation updater bot 53a3a78fb8 Localisation updates from http://translatewiki.net.
Change-Id: Ie77924787346f86d14f394c89a6f37dccf1f3e48
2013-07-24 19:55:49 +00:00
Brad Jorsch c7246a1c42 Improve disable_functions handling in LuaStandalone
If the user is on a webhost that has proc_open listed in PHP's
disable_functions directive, we should give a better error message.
Until we no longer support PHP below 5.4, we should do the same for
safe_mode. And since we're doing that, we may as well report any other
warnings if proc_open fails, too.

In addition, this cleans up error handling in
Scribunto_LuaEngine::load() so it doesn't pretend the interpreter is
loaded if getInterpreter() throws an exception. Otherwise other code
winds up with PHP fatal errors trying to access a null value.

Bug: 50706
Change-Id: I2887b722e089fd7a526aa7dcab9c80deb343d8ac
2013-07-24 15:01:36 -04:00
Translation updater bot afd13e83cd Localisation updates from http://translatewiki.net.
Change-Id: I45a742f47cf1d8ed3b5eb4733eff21e1539dca8f
2013-07-23 18:42:24 +00:00
Translation updater bot a017c47729 Localisation updates from http://translatewiki.net.
Change-Id: Iec4257e845d0885e31bbe79901124dc9aaf144d0
2013-07-15 19:29:27 +00:00
jenkins-bot b8e9e3f578 Merge "Add namespace names in Chechen language (ce)" 2013-07-14 23:51:42 +00:00
This, that and the other f4709e48f1 Add namespace names in Chechen language (ce)
Bug: 51206
Change-Id: I279325b7cda0f93c2422a9307787cddd4f5763c7
2013-07-14 23:49:38 +00:00
Translation updater bot 8f7fd19da2 Localisation updates from http://translatewiki.net.
Change-Id: Ie213a231ed96ac00321ebd6685d736f02e9f0ba0
2013-07-14 19:18:03 +00:00
Translation updater bot 6f81f87c18 Localisation updates from http://translatewiki.net.
Change-Id: I155e8026bfff9da279c25149258d5c26c0edda9a
2013-07-11 19:14:35 +00:00
jenkins-bot 635bae4786 Merge "Fix mw.ustring edge cases" 2013-07-11 18:11:51 +00:00
jenkins-bot 0f45f9e5cb Merge "Make lang:parseFormattedNumber more like tonumber" 2013-07-08 21:15:25 +00:00
Brad Jorsch cfdd099ca8 Fix fatal in frame:callParserFunction
If the parser function returns 'isChildObj', we need to create a child
frame to expand the wikitext returned by the parser function. And when
we pass the arguments to the new frame, we need to pass them through the
preprocessor's newPartNodeArray() first.

Bug: 50863
Change-Id: Ieb7cc7007288de1f7d2cd2458f068affe695e8af
2013-07-07 07:43:31 -04:00
Brad Jorsch 25cbfd776d Make lang:parseFormattedNumber more like tonumber
Users seem to expect that mw.language's parseFormattedNumber will act
like tonumber when given nil or other non-string values, returning nil
instead of raising an error. There's no reason not to, so we may as
well.

Change-Id: Ie0ff19efc84ca738e115bbd524bfd92fccf26127
2013-07-03 16:06:32 +00:00
Brad Jorsch d8314539da Fix mw.ustring edge cases
A few edge cases were being incorrectly handled:
* mw.ustring.sub( 'abc', 1, 0 ) returned 'a', not ''.
* mw.ustring.codepoint( 'abc', 1, 0 ) returned 97, not no results.
* mw.ustring.codepoint( 'abc', 4, 4 ) returned 99, not no results.
* mw.ustring.gcodepoint had the same issues as mw.ustring.codepoint.

Change-Id: Ib8c0ef5a8073106eb7d90d0aa0513be4525dca08
2013-07-03 11:49:52 -04:00
Brad Jorsch ad3e5a7c48 Fix LuaSandbox mw.ustring.byteoffset with negative 'i'
Negative values for 'i' in mw.ustring.byteoffset are supposed to count
from the end of the string. But in LuaSandbox, it was actually counting
from two bytes before the end of the string due to a typo.

Fix that, and add some tests for it.

Bug: 50176
Change-Id: Iceee1022a55abd7a08df1ea7843e1277eb02798b
2013-06-25 10:06:01 -04:00
Translation updater bot 9d187bf301 Localisation updates from http://translatewiki.net.
Change-Id: I2873c7b3be27ecc3e277150a767d82e56a21a853
2013-06-24 19:56:27 +00:00
Translation updater bot ac968ab67f Localisation updates from http://translatewiki.net.
Change-Id: I5e195b4d876b58cfefcc740f1f00c3364ab03858
2013-06-15 21:12:15 +00:00
Translation updater bot 7a664889d2 Localisation updates from http://translatewiki.net.
Change-Id: I4f9467e5dca9de3eb5f88b4e6eb5b59194501bcc
2013-06-14 21:52:59 +00:00
Brad Jorsch e12d743986 Handle bogus entries in MediaWiki:Scribunto-doc-page-name
If someone puts something broken in MediaWiki:Scribunto-doc-page-name,
it may not be possible to determine which module the page is a doc page
for. In that case, just pretend it's not a doc page.

Bug: 49322
Change-Id: Ia4421576b372e188cf7e3dfe2c0b8ce213d026d4
2013-06-07 18:21:31 -04:00
Translation updater bot 6081c4fd30 Localisation updates from http://translatewiki.net.
Change-Id: I2e8b232d72eacf4b04a7848059906541f2effc7e
2013-06-04 09:31:57 +00:00
Translation updater bot 593d7e5f59 Localisation updates from http://translatewiki.net.
Change-Id: I8458d0454cab9ba74858fde2cd57ec6156208ea4
2013-06-03 19:00:24 +00:00
Translation updater bot f015053ae9 Localisation updates from http://translatewiki.net.
Change-Id: Ie4208b29b51fba9a541bd1fae254cd9a0983e24e
2013-06-03 11:54:09 +00:00
Liangent 1050d29845 Modules should be in English (while docs are not)
Change-Id: I15c10379ab2282a508322df3914d82e1fc463a22
2013-05-29 15:08:31 +00:00
Translation updater bot 904650875c Localisation updates from http://translatewiki.net.
Change-Id: I68f12ab624e905f229078b349094c736842d89b1
2013-05-29 08:40:57 +00:00
Translation updater bot 45fb5f2456 Localisation updates from http://translatewiki.net.
Change-Id: Iac612a33013f5777dfe12f7d515150fc44b8312a
2013-05-28 06:46:47 +00:00
Translation updater bot a399a8bc77 Localisation updates from http://translatewiki.net.
Change-Id: I4e3da38389a780a880d1c86699b9aaad89a26b18
2013-05-26 08:44:06 +00:00
Translation updater bot b7788925c7 Localisation updates from http://translatewiki.net.
Change-Id: I0459f2ce2d549cf84c479c4fc76a454c3d8cc216
2013-05-24 08:37:50 +00:00
Translation updater bot 37abea396b Localisation updates from http://translatewiki.net.
Change-Id: I2725a92c673c586d3efe1934a74332d3f54e2bff
2013-05-23 05:43:09 +00:00
Translation updater bot 45b7e6d477 Localisation updates from http://translatewiki.net.
Change-Id: I06ca2457277bc9e07e96a45880809971ee2c7766
2013-05-21 05:56:42 +00:00
Translation updater bot 80caf16c17 Localisation updates from http://translatewiki.net.
Change-Id: I2e64fd58a54688b4ae9f4ac6f76b48fefd8f3f73
2013-05-16 20:16:11 +00:00
Translation updater bot 3dddf83b85 Localisation updates from http://translatewiki.net.
Change-Id: Idf162033a1423658559c91f1a676e914ef010f2f
2013-05-15 21:09:46 +00:00
jenkins-bot b0776fab0d Merge "Fix 5a2030dd for namespace names in zh and yue (zh-yue)" 2013-05-14 16:35:01 +00:00
Brad Jorsch 1ef4cd15ec Fix uncaught exception in LuaStandalone
If the interpreter exits before the end of the page, then the call to
Scribunto_LuaStandaloneEngine::getLimitReport() throws an uncaught
exception when it tries to access the interpreter. Catch it.

Change-Id: I7ce4f09b1b2206f13ab0f422de35e0b69a3b24d5
2013-05-13 16:27:37 -04:00
Translation updater bot 06d73773fc Localisation updates from http://translatewiki.net.
Change-Id: I18844db85411c1a0de587bfa987a11d86014b171
2013-05-13 19:48:47 +00:00
Brad Jorsch 82820aafc8 Add frontier pattern (%f[set]) to ustring
The "%f[set]" frontier pattern has been in Lua 5.1 since the beginning,
but was undocumented until Lua 5.2. And the code is even unchanged from
5.1.0 to 5.2.1. So there's no reason not to implement it in ustring too.

Note the changes to UstringLibrary.php are somewhat large, because it
splits the "convert a Lua bracketed charset to PCRE" code into a
separate function and it changes the handling of mw.ustring.find's and
mw.ustring.match's 'init' parameter from "substring, match from 0, then
add back on $init" to "use preg_match's $offset and use \G instead of ^
where this matters". Both of these are necessary to properly support
%f.

This also fixes a bug in the pure-Lua code (not used in Scribunto)
exposed by the unit tests for %f where %z was matching '\1' rather than
'\0' and %Z everything except '\1' instead of everything except '\0'.

Bug: 48331
Change-Id: Ie0b95ef5b734db53d6adc9de5dae4874f8944c08
2013-05-12 10:27:36 -04:00
Brad Jorsch d6f3633428 (bug 47365) Fix edge cases in mw.ustring.find, mw.ustring.match
The following errors are fixed:
* PHP warning and wrong return value with empty pattern and plain
* Incorrect offsets returned when init is larger than the string length
* Incorrect captured offsets returned when init is excessively negative

Bug: 47365
Change-Id: I9741418287dc727747326d6a19678370ce155a2b
2013-05-10 06:00:02 +00:00
Translation updater bot eff08defec Localisation updates from http://translatewiki.net.
Change-Id: I4bef7c8e24caeff4e0cc9691f5d1fd7c60ba5b52
2013-05-06 20:21:26 +00:00
Translation updater bot a70b9fa9fb Localisation updates from http://translatewiki.net.
Change-Id: If111fffe2aecab406739c46f5163feb565b8250e
2013-05-05 21:10:28 +00:00
Translation updater bot 86521cf18d Localisation updates from http://translatewiki.net.
Change-Id: I9d6856a7653179a0254051f1ec5ea3e7ace853ef
2013-05-04 20:24:55 +00:00
Brad Jorsch 1e02fad924 Fix content format for ScribuntoContentHander
We had intended to use the constant CONTENT_FORMAT_TEXT, but
accidentally used that as a string instead.

Change-Id: I93a2c02d48d3fd7b73530562165d817965e272d1
2013-04-30 14:28:14 -04:00
Translation updater bot 3515465c9a Localisation updates from http://translatewiki.net.
Change-Id: Ieb2ff4593932ce69231675846423479907b17aaa
2013-04-28 23:57:45 +00:00
Translation updater bot 20ed7a9d1d Localisation updates from http://translatewiki.net.
Change-Id: I32fa55c8d7ab68610f18ed3d940787b31f232e92
2013-04-26 22:14:07 +00:00
Liangent d4286e271d Fix 5a2030dd for namespace names in zh and yue (zh-yue)
* zh names are dropped to use fallback.
* zh-yue is renamed to yue, with talk namespace name added.

Change-Id: I9b0e0e5ab03a70bcbbc052ef4e6c753574e73e13
2013-04-26 19:00:33 +08:00
Brad Jorsch 3622f82bd1 (bug 47300) Fix sandboxing with require
Two related issues:
* The package module was inheriting the loaders from the outer sandbox,
  so loaded modules were being loaded into the outer sandbox's
  environment.
* mw.loadData was using the outer sandbox's require(), so again loaded
  modules were being loaded into the outer sandbox's environment.

Bug: 47300
Change-Id: I48d8dd4784c9a890e3abb6389f96f38e1420dbbb
2013-04-24 06:19:44 +00:00
Translation updater bot 0faada1ddf Localisation updates from http://translatewiki.net.
Change-Id: Iba12005176fad06d4352f1dfea3b462ab952bc34
2013-04-23 20:11:51 +00:00
jenkins-bot 970a83ae97 Merge "(bug 47262) Magic word localization in Galician." 2013-04-23 11:43:50 +00:00
Dereckson 4c92452d50 (bug 47262) Magic word localization in Galician.
#invoke -> #chamar

Bug: 47262
Change-Id: I738ad78b30193ca9227a932b768a7c62bf76022c
2013-04-23 11:43:21 +00:00