Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
a2efdb87
Commit
a2efdb87
authored
Apr 3, 2014
by
Thomas Müller
Browse files
Options
Downloads
Plain Diff
Merge pull request #7970 from owncloud/webdav-upload-hash
Fix uploading files containing a # in the path for webdav
parents
54783550
76c63a57
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/files_external/lib/webdav.php
+1
-1
1 addition, 1 deletion
apps/files_external/lib/webdav.php
tests/lib/files/storage/storage.php
+20
-1
20 additions, 1 deletion
tests/lib/files/storage/storage.php
with
21 additions
and
2 deletions
apps/files_external/lib/webdav.php
+
1
−
1
View file @
a2efdb87
...
...
@@ -267,7 +267,7 @@ class DAV extends \OC\Files\Storage\Common {
$curl
=
curl_init
();
curl_setopt
(
$curl
,
CURLOPT_USERPWD
,
$this
->
user
.
':'
.
$this
->
password
);
curl_setopt
(
$curl
,
CURLOPT_URL
,
$this
->
createBaseUri
()
.
str_replace
(
' '
,
'%20'
,
$target
));
curl_setopt
(
$curl
,
CURLOPT_URL
,
$this
->
createBaseUri
()
.
$this
->
encodePath
(
$target
));
curl_setopt
(
$curl
,
CURLOPT_BINARYTRANSFER
,
true
);
curl_setopt
(
$curl
,
CURLOPT_INFILE
,
$source
);
// file pointer
curl_setopt
(
$curl
,
CURLOPT_INFILESIZE
,
filesize
(
$path
));
...
...
This diff is collapsed.
Click to expand it.
tests/lib/files/storage/storage.php
+
20
−
1
View file @
a2efdb87
...
...
@@ -326,4 +326,23 @@ abstract class Storage extends \PHPUnit_Framework_TestCase {
$this
->
assertEquals
(
hash
(
$type
,
$data
),
$this
->
instance
->
hash
(
$type
,
'hash.txt'
));
$this
->
assertEquals
(
hash
(
$type
,
$data
,
true
),
$this
->
instance
->
hash
(
$type
,
'hash.txt'
,
true
));
}
public
function
testHashInFileName
()
{
$this
->
instance
->
file_put_contents
(
'#test.txt'
,
'data'
);
$this
->
assertEquals
(
'data'
,
$this
->
instance
->
file_get_contents
(
'#test.txt'
));
$this
->
instance
->
mkdir
(
'#foo'
);
$this
->
instance
->
file_put_contents
(
'#foo/test.txt'
,
'data'
);
$this
->
assertEquals
(
'data'
,
$this
->
instance
->
file_get_contents
(
'#foo/test.txt'
));
$dh
=
$this
->
instance
->
opendir
(
'#foo'
);
$content
=
array
();
while
(
$file
=
readdir
(
$dh
))
{
if
(
$file
!=
'.'
and
$file
!=
'..'
)
{
$content
[]
=
$file
;
}
}
$this
->
assertEquals
(
array
(
'test.txt'
),
$content
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment