Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 138e882

Browse files
committed
Fix error on # and ? on file name
1 parent 5b02c82 commit 138e882

File tree

5 files changed

+6
-11
lines changed

5 files changed

+6
-11
lines changed

core/src/plugins/access.fs/class.fsAccessWrapper.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,10 @@ class fsAccessWrapper implements AjxpWrapper
6969
protected static function initPath($path, $streamType, $storeOpenContext = false, $skipZip = false)
7070
{
7171
$path = self::unPatchPathForBaseDir($path);
72-
$url = parse_url($path);
72+
$url = AJXP_Utils::safeParseUrl($path);
7373
$repoId = $url["host"];
7474
$test = trim($url["path"], "/");
7575
$atRoot = empty($test);
76-
if (isSet($url["fragment"]) && strlen($url["fragment"]) > 0) {
77-
$url["path"] .= "#".$url["fragment"];
78-
}
7976
$repoObject = ConfService::getRepositoryById($repoId);
8077
if(!isSet($repoObject)) throw new Exception("Cannot find repository with id ".$repoId);
8178
$split = UserSelection::detectZip($url["path"]);

core/src/plugins/access.s3/class.s3AccessWrapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class s3AccessWrapper extends fsAccessWrapper
4242
*/
4343
protected static function initPath($path, $streamType, $storeOpenContext = false, $skipZip = false)
4444
{
45-
$url = parse_url($path);
45+
$url = AJXP_Utils::safeParseUrl($path);
4646
$repoId = $url["host"];
4747
$repoObject = ConfService::getRepositoryById($repoId);
4848
if (!isSet($repoObject)) {

core/src/plugins/access.smb/class.smbAccessWrapper.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,7 @@ class smbAccessWrapper extends fsAccessWrapper
3939
*/
4040
protected static function initPath($path, $streamType, $storeOpenContext = false, $skipZip = false)
4141
{
42-
$url = parse_url($path);
43-
if (isSet($url["fragment"]) && strlen($url["fragment"]) > 0) {
44-
$url["path"] .= "#".$url["fragment"];
45-
}
42+
$url = AJXP_Utils::safeParseUrl($path);
4643
$repoId = $url["host"];
4744
$repoObject = ConfService::getRepositoryById($repoId);
4845
if(!isSet($repoObject)) throw new Exception("Cannot find repository with id ".$repoId);

core/src/plugins/access.swift/class.swiftAccessWrapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class swiftAccessWrapper extends fsAccessWrapper
4242
*/
4343
protected static function initPath($path, $streamType, $storeOpenContext = false, $skipZip = false)
4444
{
45-
$url = parse_url($path);
45+
$url = AJXP_Utils::safeParseUrl($path);
4646
$repoId = $url["host"];
4747
$repoObject = ConfService::getRepositoryById($repoId);
4848
if (!isSet($repoObject)) {

core/src/plugins/access.webdav/class.webdavAccessWrapper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ class webdavAccessWrapper extends fsAccessWrapper
4141
*/
4242
protected static function initPath($path, $streamType, $storeOpenContext = false, $skipZip = false)
4343
{
44-
$url = parse_url($path);
44+
$url = AJXP_Utils::safeParseUrl($path);
45+
4546
$repoId = $url["host"];
4647
$repoObject = ConfService::getRepositoryById($repoId);
4748
if (!isSet($repoObject)) {

0 commit comments

Comments
 (0)