[wp-trac] [WordPress Trac] #44532: Extreme memory leak related to wp_is_stream in wp-includes/functions.php in WordPress 4.9.7
WordPress Trac
noreply at wordpress.org
Mon Jul 16 00:01:48 UTC 2018
#44532: Extreme memory leak related to wp_is_stream in wp-includes/functions.php in
WordPress 4.9.7
-----------------------------------------+---------------------
Reporter: timbowesohft | Owner: (none)
Type: defect (bug) | Status: new
Priority: high | Milestone: 4.9.8
Component: Media | Version: 4.9.7
Severity: major | Resolution:
Keywords: has-patch reporter-feedback | Focuses:
-----------------------------------------+---------------------
Comment (by tristanleboss):
If the problem comes from the repeated call to `stream_get_wrappers`, why
don't we cache the output of this function in a function static variable?
I mean it's not supposed to change during the same request.
{{{#!php
<?php
function test()
{
static $stream_get_wrappers = null;
if( is_null($stream_get_wrappers) )
{
$stream_get_wrappers = stream_get_wrappers();
}
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44532#comment:42>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list