Cache patterns and the regexes they become, avoid revalidating the same
pattern multiple times, and don't bother checking if something is a string
when we just made it one.
Change-Id: I1a61dd0a36eb449c8acdc8c1be68aae793f172d3
It's not necessary, it makes the output bigger, and some pages have enough
elements with CSS that it does make an actual difference.
Change-Id: I80d471899c7e04a8a4876c205198a8c0d0b1f281
If a function name contains an equals sign, it doesn't increase the index,
so indexOffset=1 makes Lua see arguments as starting with 0. This change
fixes that, so that indexOffset is only set to 1 if the function name has
an index.
Change-Id: Ifa2dfad4d2f7228c3fd5721ccfc4c235576b663d
When calling getContent() on the page currently being viewed, set
vary-revision on the parser output, as is done when a page transcludes
itself.
Change-Id: I908f095935067dc24dd561192b0699c602cb605f
In Ia4d58f44, the code enabling __pairs to work no longer ran inside
MWServer.lua, so it hasn't worked right for serialization since then. This
restores the correct behavior.
Change-Id: Iea31ab363957f5f69838d6715527cf822c15fa94
Add a way to fetch cascading protection information from Lua without
needing to call the CASCADINGSOURCES parser function.
Change-Id: I1b3ac18af11d3066f78d27b31da8d6709a6a2631
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
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
The pattern used by cssEncode is unnecessarily complicated. Simplify it by
using a negating pattern.
Change-Id: I5dc7169efea63473e9e23a1450d2941e434a00d8
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
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
Clean up trailing whitespace from all of our code, and add comments
indicating that apparently unused variables are ScopedCallbacks.
Change-Id: I8e5997797cc7b1c64c5351ec112a18f30edc8fef