[wp-trac] [WordPress Trac] #34591: BugFix to WP_Scripts::do_item(), remove doubled "//"
WordPress Trac
noreply at wordpress.org
Thu Nov 5 11:40:38 UTC 2015
#34591: BugFix to WP_Scripts::do_item(), remove doubled "//"
---------------------------+------------------------------
Reporter: jan.mazanek | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Script Loader | Version: 4.3.1
Severity: normal | Resolution:
Keywords: | Focuses:
---------------------------+------------------------------
Comment (by jan.mazanek):
To be able to update Wordpress, untill this fix is includec, it should be
more secure to solve this with filter:
{{{
function abeo_script_loader_src($src, $handle) {
$path = parse_url($src, PHP_URL_PATH);
if(!empty($path)) {
$replaced = 0;
$pathReplaced = str_replace('//', '/', $path, $replaced);
if($replaced) {
$src = str_replace($path, $pathReplaced, $src);
}
}
return $src;
}
add_filter('script_loader_src', 'abeo_script_loader_src', 10, 2);
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34591#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list