Skip to content

Commit

Permalink
Update File.php (Windows path fixes) (#435)
Browse files Browse the repository at this point in the history
On Windows ensure that the PGTStorage path has a trailing '/'
  • Loading branch information
xamount committed Aug 28, 2023
1 parent f3db27e commit 17a0c4d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions source/CAS/PGTStorage/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down

0 comments on commit 17a0c4d

Please sign in to comment.