mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-11-24 08:14:09 +00:00
Merge "Remove limits on mw.language:formatDate()"
This commit is contained in:
commit
ef52986197
|
@ -2,11 +2,9 @@
|
|||
|
||||
class Scribunto_LuaLanguageLibrary extends Scribunto_LuaLibraryBase {
|
||||
const MAX_LANG_CACHE_SIZE = 20;
|
||||
const MAX_TIME_CHARS = 6000;
|
||||
|
||||
var $langCache = array();
|
||||
var $timeCache = array();
|
||||
var $timeChars = 0;
|
||||
|
||||
function register() {
|
||||
// Pre-populate the language cache
|
||||
|
@ -263,11 +261,6 @@ class Scribunto_LuaLanguageLibrary extends Scribunto_LuaLibraryBase {
|
|||
return array( $this->timeCache[$format][$cacheKey][$langcode][$local] );
|
||||
}
|
||||
|
||||
$this->timeChars += strlen( $format );
|
||||
if ( $this->timeChars > self::MAX_TIME_CHARS ) {
|
||||
throw new Scribunto_LuaError( "Too many calls to mw.language:formatDate()" );
|
||||
}
|
||||
|
||||
# Default input timezone is UTC.
|
||||
try {
|
||||
$utc = new DateTimeZone( 'UTC' );
|
||||
|
|
Loading…
Reference in a new issue