[wp-trac] [WordPress Trac] #46089: Memory exhaustion when setting script translations on `wp-i18n`
WordPress Trac
noreply at wordpress.org
Thu Jan 24 01:11:04 UTC 2019
#46089: Memory exhaustion when setting script translations on `wp-i18n`
---------------------------+------------------------------
Reporter: aduth | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Script Loader | Version:
Severity: normal | Resolution:
Keywords: has-patch | Focuses:
---------------------------+------------------------------
Comment (by aduth):
It's a bit more complex unfortunately, since even with the patch, the same
issue would occur when calling `wp_set_script_translations` with `wp-
polyfill`, since `wp-polyfill` is itself a dependency ''of'' `wp-i18n`.
https://github.com/WordPress/wordpress-
develop/blob/ad0a1a2f8280bb421d36a0f1080080e7c0f7c6d8/src/wp-includes
/script-loader.php#L425
Handling this then becomes even more clumsy:
{{{#!php
<?php
if ( 'wp-i18n' !== $handle && ! in_array( 'wp-i18n', $obj->deps, true ) &&
( ! isset( $this->registered['wp-i18n'] ) || ! in_array(
$handle, $this->registered['wp-i18n']->deps ) ) ) {
$obj->deps[] = 'wp-i18n';
}
}}}
Since context was omitted, the issue becomes most apparent from the
Gutenberg plugin in trying to re-register all of the packaged scripts. A
workaround will be implemented there in the meantime.
https://github.com/WordPress/gutenberg/pull/12559
--
Ticket URL: <https://core.trac.wordpress.org/ticket/46089#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list