From 73cdad96325ced44699358287d33df1ab834e200 Mon Sep 17 00:00:00 2001
From: Ken Mortimer <kgf.mortimer@gmail.com>
Date: Mon, 28 Apr 2025 14:56:00 +1000
Subject: [PATCH] Ensure the resolved local path is used when getting the file.

---
 src/Storage.php | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/Storage.php b/src/Storage.php
index 19b2924..64e5e2d 100644
--- a/src/Storage.php
+++ b/src/Storage.php
@@ -18,7 +18,7 @@ class Storage {
    *
    * @var string
    */
-  const LOCAL_FOLDER = 'private://data_pipelines_sftp/cache';
+  const string LOCAL_FOLDER = 'private://data_pipelines_sftp/cache';
 
   /**
    * A method to get the local path for storage.
@@ -99,8 +99,9 @@ class Storage {
    *   The resource of the local file.
    */
   public function getLocalCopy(string $path): mixed {
-    if (is_readable($this->getLocalPath($path))) {
-      if ($stream = fopen($path, 'r')) {
+    $local_path = $this->getLocalPath($path);
+    if (is_readable($local_path)) {
+      if ($stream = fopen($local_path, 'r')) {
         rewind($stream);
         return $stream;
       }
-- 
GitLab