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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
3e77f3f5
Commit
3e77f3f5
authored
14 years ago
by
Robin Appelman
Browse files
Options
Downloads
Patches
Plain Diff
fix sqlite compatibility for webdav server
parent
d4fa1dda
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
inc/HTTP/WebDAV/Server/Filesystem.php
+22
-16
22 additions, 16 deletions
inc/HTTP/WebDAV/Server/Filesystem.php
with
22 additions
and
16 deletions
inc/HTTP/WebDAV/Server/Filesystem.php
+
22
−
16
View file @
3e77f3f5
...
@@ -512,15 +512,17 @@
...
@@ -512,15 +512,17 @@
}
}
$destpath
=
$this
->
_unslashify
(
$options
[
"dest"
]);
$destpath
=
$this
->
_unslashify
(
$options
[
"dest"
]);
if
(
is_dir
(
$source
))
{
if
(
is_dir
(
$source
))
{
$dpath
=
OC_DB
::
escape
(
$destpath
);
$path
=
OC_DB
::
escape
(
$options
[
"path"
]);
$query
=
"UPDATE
{
$CONFIG_DBTABLEPREFIX
}
properties
$query
=
"UPDATE
{
$CONFIG_DBTABLEPREFIX
}
properties
SET path = REPLACE(path, '
"
.
$options
[
"path"
]
.
"', '"
.
$dest
path
.
"
')
SET path = REPLACE(path, '
$path
', '
$d
path
')
WHERE path LIKE '
"
.
$this
->
_slashify
(
$options
[
"path"
])
.
"
%'"
;
WHERE path LIKE '
$path
%'"
;
OC_DB
::
query
(
$query
);
OC_DB
::
query
(
$query
);
}
}
$query
=
"UPDATE
{
$CONFIG_DBTABLEPREFIX
}
properties
$query
=
"UPDATE
{
$CONFIG_DBTABLEPREFIX
}
properties
SET path = '
"
.
$dest
path
.
"
'
SET path = '
$d
path
'
WHERE path = '
"
.
$options
[
"path"
]
.
"
'"
;
WHERE path = '
$path
'"
;
OC_DB
::
query
(
$query
);
OC_DB
::
query
(
$query
);
}
else
{
}
else
{
if
(
OC_FILESYSTEM
::
is_dir
(
$source
))
{
if
(
OC_FILESYSTEM
::
is_dir
(
$source
))
{
...
@@ -553,7 +555,7 @@
...
@@ -553,7 +555,7 @@
}
}
}
else
{
}
else
{
if
(
!
OC_FILESYSTEM
::
copy
(
$file
,
$destfile
))
{
if
(
!
OC_FILESYSTEM
::
copy
(
$file
,
$destfile
))
{
return
"409 Conflict
"
;
return
"409 Conflict
(
$source
)
$file
-->
$destfile
"
.
implode
(
'::'
,
$files
)
;
}
}
}
}
}
}
...
@@ -581,10 +583,14 @@
...
@@ -581,10 +583,14 @@
if
(
$prop
[
"ns"
]
==
"DAV:"
)
{
if
(
$prop
[
"ns"
]
==
"DAV:"
)
{
$options
[
"props"
][
$key
][
'status'
]
=
"403 Forbidden"
;
$options
[
"props"
][
$key
][
'status'
]
=
"403 Forbidden"
;
}
else
{
}
else
{
$path
=
OC_DB
::
escape
(
$options
[
'path'
]);
$name
=
OC_DB
::
escape
(
$prop
[
'name'
]);
$ns
=
OC_DB
::
escape
(
$prop
[
'ns'
]);
$val
=
OC_DB
::
escape
(
$prop
[
'val'
]);
if
(
isset
(
$prop
[
"val"
]))
{
if
(
isset
(
$prop
[
"val"
]))
{
$query
=
"REPLACE INTO
{
$CONFIG_DBTABLEPREFIX
}
properties
SET path = '
$options[
path
]
',
name = '
$prop[
name
]
',
ns= '
$prop[
ns
]
',
value = '
$prop[
val
]
'"
;
$query
=
"REPLACE INTO
{
$CONFIG_DBTABLEPREFIX
}
properties
(path,name,ns,value) VALUES('
$
path
',
'
$
name
',
'
$
ns
',
'
$
val
'
)
"
;
}
else
{
}
else
{
$query
=
"DELETE FROM
{
$CONFIG_DBTABLEPREFIX
}
properties WHERE path = '
$
options[
path
]
' AND name = '
$
prop[
name
]
' AND ns = '
$
prop[
ns
]
'"
;
$query
=
"DELETE FROM
{
$CONFIG_DBTABLEPREFIX
}
properties WHERE path = '
$path
' AND name = '
$name
' AND ns = '
$ns
'"
;
}
}
OC_DB
::
query
(
$query
);
OC_DB
::
query
(
$query
);
}
}
...
@@ -659,15 +665,15 @@
...
@@ -659,15 +665,15 @@
}
}
}
}
$query
=
"INSERT INTO `
{
$CONFIG_DBTABLEPREFIX
}
locks`
$locktoken
=
OC_DB
::
escape
(
$options
[
'locktoken'
]);
SET `token` = '
$options[locktoken]
'
$path
=
OC_DB
::
escape
(
$options
[
'path'
]);
, `path` = '
$options[path]
'
$time
=
time
();
, `created` = "
.
time
()
.
"
$owner
=
OC_DB
::
escape
(
$options
[
'owner'
]);
, `modified` = "
.
time
()
.
"
$timeout
=
OC_DB
::
escape
(
$options
[
'timeout'
]);
, `owner` = '
$options[owner]
'
$exclusive
=
(
$options
[
'scope'
]
===
"exclusive"
?
"1"
:
"0"
);
, `expires` = '
$options[timeout]
'
$query
=
"INSERT INTO `
{
$CONFIG_DBTABLEPREFIX
}
locks`
, `exclusivelock` = "
.
(
$options
[
'scope'
]
===
"exclusive"
?
"1"
:
"0"
)
.
"
(`token`,`path`,`created`,`modified`,`owner`,`expires`,`exclusivelock`,`recursive`)
, `recursive` =
$recursion
"
;
VALUES ('
$locktoken
','
$path
',
$time
,
$time
,'
$owner
','timeout',
$exclusive
,
$recursion
)
"
;
OC_DB
::
query
(
$query
);
OC_DB
::
query
(
$query
);
$rows
=
OC_DB
::
affected_rows
();
$rows
=
OC_DB
::
affected_rows
();
if
(
!
OC_FILESYSTEM
::
file_exists
(
$fspath
)
and
$rows
>
0
)
{
if
(
!
OC_FILESYSTEM
::
file_exists
(
$fspath
)
and
$rows
>
0
)
{
...
...
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