From 31c5809e4ae3525590d04471cd83c5a012b4dede Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Mon, 22 Apr 2019 14:43:54 -0600 Subject: [PATCH] Better fix for #2470 --- system/src/Grav/Common/Assets.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/system/src/Grav/Common/Assets.php b/system/src/Grav/Common/Assets.php index 82d395921..74ba296d0 100644 --- a/system/src/Grav/Common/Assets.php +++ b/system/src/Grav/Common/Assets.php @@ -267,6 +267,22 @@ class Assets extends PropertyObject protected function filterAssets($assets, $key, $value, $sort = false) { $results = array_filter($assets, function($asset) use ($key, $value) { + + if ($key === 'position' && $value === 'pipeline') { + + $type = $asset->getType(); + + if ($asset->getRemote() && $this->{$type . '_pipeline_include_externals'} === false && $asset['position'] === 'pipeline' ) { + if ($this->{$type . '_pipeline_before_excludes'}) { + $asset->setPosition('after'); + } else { + $asset->setPosition('before'); + } + return false; + } + + } + if ($asset[$key] === $value) return true; return false; });