1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-10-22 00:56:08 +02:00

Canonicalize paths when constructing RotatingFileHandler/StreamHandler, fixes #1326

This commit is contained in:
Jordi Boggiano
2020-05-21 16:54:57 +02:00
parent acd3173c4a
commit c50950d79e
4 changed files with 57 additions and 2 deletions

View File

@@ -12,6 +12,7 @@
namespace Monolog\Handler;
use Monolog\Logger;
use Monolog\Utils;
/**
* Stores to any stream resource
@@ -45,7 +46,7 @@ class StreamHandler extends AbstractProcessingHandler
if (is_resource($stream)) {
$this->stream = $stream;
} elseif (is_string($stream)) {
$this->url = $stream;
$this->url = Utils::canonicalizePath($stream);
} else {
throw new \InvalidArgumentException('A stream must either be a resource or a string.');
}