Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/Assetic/Asset/HttpAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,13 @@ public function load(?FilterInterface $additionalFilter = null)
public function getLastModified()
{
if (false !== @file_get_contents($this->sourceUrl, false, stream_context_create(array('http' => array('method' => 'HEAD'))))) {
// TODO: $http_response_header deprecated since PHP 8.5
// Remove when min PHP >= 8.4 and use http_get_last_response_headers() directly
// http_get_last_response_headers() was added in PHP 8.4; older versions fall back
// to the predefined $http_response_header. The `?? []` coalescing read avoids the
// PHP 8.5 deprecation of that variable: a bare read is flagged at compile time,
// a coalescing read is not. Drop the fallback once the minimum PHP version is >= 8.4.
$headers = function_exists('http_get_last_response_headers')
? http_get_last_response_headers()
: $http_response_header;
: ($http_response_header ?? []);
foreach ($headers as $header) {
if (0 === stripos($header, 'Last-Modified: ')) {
list(, $mtime) = explode(':', $header, 2);
Expand Down
3 changes: 2 additions & 1 deletion src/Assetic/Factory/Loader/BasePhpFormulaLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ private function processCall($call, array $protoOptions = [])
$call,
'echo serialize($_call);',
)));
$args = unserialize(shell_exec('php ' . escapeshellarg($tmp)));
$output = shell_exec('php ' . escapeshellarg($tmp));
$args = is_string($output) ? unserialize($output) : [];
unlink($tmp);

$inputs = isset($args[0]) ? self::argumentToArray($args[0]) : [];
Expand Down
1 change: 1 addition & 0 deletions src/Assetic/Filter/CssImportFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Assetic\Asset\HttpAsset;
use Assetic\Factory\AssetFactory;
use Assetic\Contracts\Filter\DependencyExtractorInterface;
use Assetic\Contracts\Filter\FilterInterface;

/**
* Inlines imported stylesheets.
Expand Down
Loading