Skip to content

Commit 9d6ccc0

Browse files
committed
Merge branch '579-fixes-nested-sub-path' of github.com:ubc-cpsc/php-saml into ubc-cpsc-579-fixes-nested-sub-path
2 parents d3b5172 + 919e78f commit 9d6ccc0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Saml2/Utils.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -722,8 +722,10 @@ protected static function buildWithBaseURLPath($info)
722722
if (!empty($baseURLPath)) {
723723
$result = $baseURLPath;
724724
if (!empty($info)) {
725-
$path = explode('/', $info);
726-
$extractedInfo = array_pop($path);
725+
// Remove base path from the path info.
726+
$extractedInfo = str_replace($baseURLPath, '', $info);
727+
// Remove starting and ending slash.
728+
$extractedInfo = trim($extractedInfo, '/');
727729
if (!empty($extractedInfo)) {
728730
$result .= $extractedInfo;
729731
}

0 commit comments

Comments
 (0)