From 40ed8f829b69363198bdd6ebfdf25ed2aac59f8a Mon Sep 17 00:00:00 2001 From: xamount Date: Fri, 25 Aug 2023 17:00:33 -0400 Subject: [PATCH] Update File.php (Windows path fixes) On Windows ensure that the PGTStorage path has a trailing '/' --- source/CAS/PGTStorage/File.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/CAS/PGTStorage/File.php b/source/CAS/PGTStorage/File.php index fbacd3b7..213ab40b 100644 --- a/source/CAS/PGTStorage/File.php +++ b/source/CAS/PGTStorage/File.php @@ -127,6 +127,12 @@ function __construct($cas_parent,$path) if (!preg_match('`^[a-zA-Z]:`', $path)) { phpCAS::error('an absolute path is needed for PGT storage to file'); } + + // ensure that the directory separator on Windows is '/' for consistency with the rest of the phpcas code + $path = str_replace(DIRECTORY_SEPARATOR , '/', $path); + + // store the path (with a trailing '/') + $path = preg_replace('|([^/])$|', '$1/', $path); } else {