mediawiki-extensions-Scribunto/includes/Engines/LuaCommon
theknightwho acd7ec66ea Avoid modules that should return false wrongly returning true
When modules are first loaded by `require` in package.lua, it checks
for a return value with `if res then`. If that check fails, the module
will be cached with the default value `true` at line 109, and that
value is then returned.

That check should be changed to `if res ~= nil then`, because
otherwise a module with a return value of `false` will be cached with
the value `true`.

This also necessitates a corresponding change to the check at line 93,
which is when `package.loaded` is initially checked to see if a package
has been loaded before, as that value could be `false`.

Bug: T362045
Change-Id: Id42e26a922c13971c25ed8654e822dc6fdcb6ca7
2024-05-24 02:10:41 +00:00
..
lualib Avoid modules that should return false wrongly returning true 2024-05-24 02:10:41 +00:00
HashLibrary.php Capitalise Engines folder 2022-09-30 00:58:27 +00:00
HtmlLibrary.php Capitalise Engines folder 2022-09-30 00:58:27 +00:00
LanguageLibrary.php LanguageLibrary: Ensure language code is a string 2024-04-11 16:20:24 +00:00
LibraryBase.php Replace some moved Title class uses, now MediaWiki\Title\Title 2023-08-19 12:22:05 +00:00
LuaEngine.php Use ObjectCacheFactory instead of deprecated ObjectCache method 2024-05-14 20:07:42 +00:00
LuaError.php Use namespaced classes 2024-01-05 19:24:06 +01:00
LuaInterpreter.php Capitalise Engines folder 2022-09-30 00:58:27 +00:00
LuaInterpreterBadVersionError.php Replace deprecated MWException 2023-06-09 14:43:44 +02:00
LuaInterpreterNotExecutableError.php Replace deprecated MWException 2023-06-09 14:43:44 +02:00
LuaInterpreterNotFoundError.php Replace deprecated MWException 2023-06-09 14:43:44 +02:00
LuaModule.php Use namespaced classes 2024-01-05 19:24:06 +01:00
MessageLibrary.php Update moved class RawMessage 2023-05-19 10:31:10 +00:00
SiteLibrary.php Replace global configuration variables 2024-03-18 04:40:44 +00:00
TextLibrary.php Replace global configuration variables 2024-03-18 04:40:44 +00:00
TitleLibrary.php TitleLibrary: Don't register external titles as dependencies 2024-04-10 11:32:44 -04:00
UriLibrary.php Add redirects for modules 2023-12-13 17:34:30 -05:00
UstringLibrary.php Add explicit parentheses around mixed boolean operator 2024-03-23 00:59:35 +01:00