Skip to content

Commit 17a0c4d

Browse files
authored
Update File.php (Windows path fixes) (apereo#435)
On Windows ensure that the PGTStorage path has a trailing '/'
1 parent f3db27e commit 17a0c4d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

source/CAS/PGTStorage/File.php

+6
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ function __construct($cas_parent,$path)
127127
if (!preg_match('`^[a-zA-Z]:`', $path)) {
128128
phpCAS::error('an absolute path is needed for PGT storage to file');
129129
}
130+
131+
// ensure that the directory separator on Windows is '/' for consistency with the rest of the phpcas code
132+
$path = str_replace(DIRECTORY_SEPARATOR , '/', $path);
133+
134+
// store the path (with a trailing '/')
135+
$path = preg_replace('|([^/])$|', '$1/', $path);
130136

131137
} else {
132138

0 commit comments

Comments
 (0)