Steps to reproduce
- try to rename a file into something containing a hash
# or a question-mark ?
Expected behaviour
file renamed correctly
Actual behaviour
- if a filename didn't contain a problematic char
#/? before the rename and the resulting filename is different to the source filename when you strip away anything after the #/? (e.g. rename file => file2#123): the UI shows the correct new filename but after a reload you see that the problematic char #/? got striped away silently from the name
- if a filename didn't contain a problematic char
#/?`` before the rename and the resulting filename is same as source filename when you strip away anything after the #/?(e.g. renamefile=>file#123): an error is displayed The name "file#123" is already used in the folder "/". Please choose a different name.`
- if the filename did already contain a problematic char
#/? before the rename and the new name only changes characters after the problematic char #/? (eg. rename file# to file#.txt: an error is displayed Could not rename "file#"
- if the filename did already contain a problematic char
#/? before the rename and the new name only changes characters before the hash # (eg. rename file# to file2#: the UI shows the correct new filename but after a reload you see that the problematic char #/? got striped away silently from the name. This is why UI tests fail with

Issue started from #28732
Server configuration
Operating system:
Debian
Web server:
Apache
Database:
SQlite
PHP version:
7.1.6
ownCloud version: (see ownCloud admin page)
git master
Updated from an older ownCloud or fresh install:
fresh
Where did you install ownCloud from:
git
Client configuration
Browser:
FF 55, Chrome 60
Operating system:
Debian
ownCloud log (data/owncloud.log)
for case 1 in "Actual behaviour": none
for case 2 in "Actual behaviour":
{"reqId":"WL5v0sjCQwuB1WhFilWG","level":0,"time":"2017-08-21T06:00:31+00:00","remoteAddr":"::1","user":"admin","app":"webdav","method":"MOVE","url":"\/owncloud-core\/remote.php\/dav\/files\/admin\/file","message":"Exception: {\"Message\":\"HTTP\\\/1.1 412 The destination node already exists, and the overwrite header is set to false\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\PreconditionFailed\",\"Code\":0,\"Trace\":\"#0 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(624): Sabre\\\\DAV\\\\Server->getCopyAndMoveInfo(Object(Sabre\\\\HTTP\\\\Request))\\n#1 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpMove(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#2 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#3 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:MOVE', Array)\\n#4 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#5 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/dav\\\/lib\\\/Server.php(234): Sabre\\\\DAV\\\\Server->exec()\\n#6 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#7 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/remote.php(175): require_once('\\\/home\\\/artur\\\/www...')\\n#8 {main}\",\"File\":\"\\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php\",\"Line\":758,\"User\":\"admin\"}"}
for case 3 in "Actual behaviour":
{"reqId":"o9WwvkJiKoDyipzS55ck","level":0,"time":"2017-08-21T06:01:25+00:00","remoteAddr":"::1","user":"admin","app":"webdav","method":"MOVE","url":"\/owncloud-core\/remote.php\/dav\/files\/admin\/file","message":"Exception: {\"Message\":\"HTTP\\\/1.1 412 The destination node already exists, and the overwrite header is set to false\",\"Exception\":\"Sabre\\\\DAV\\\\Exception\\\\PreconditionFailed\",\"Code\":0,\"Trace\":\"#0 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/CorePlugin.php(624): Sabre\\\\DAV\\\\Server->getCopyAndMoveInfo(Object(Sabre\\\\HTTP\\\\Request))\\n#1 [internal function]: Sabre\\\\DAV\\\\CorePlugin->httpMove(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#2 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/event\\\/lib\\\/EventEmitterTrait.php(105): call_user_func_array(Array, Array)\\n#3 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(479): Sabre\\\\Event\\\\EventEmitter->emit('method:MOVE', Array)\\n#4 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php(254): Sabre\\\\DAV\\\\Server->invokeMethod(Object(Sabre\\\\HTTP\\\\Request), Object(Sabre\\\\HTTP\\\\Response))\\n#5 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/dav\\\/lib\\\/Server.php(234): Sabre\\\\DAV\\\\Server->exec()\\n#6 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/apps\\\/dav\\\/appinfo\\\/v2\\\/remote.php(31): OCA\\\\DAV\\\\Server->exec()\\n#7 \\\/home\\\/artur\\\/www\\\/owncloud-core\\\/remote.php(175): require_once('\\\/home\\\/artur\\\/www...')\\n#8 {main}\",\"File\":\"\\\/home\\\/artur\\\/www\\\/owncloud-core\\\/lib\\\/composer\\\/sabre\\\/dav\\\/lib\\\/DAV\\\/Server.php\",\"Line\":758,\"User\":\"admin\"}"}
for case 4 in "Actual behaviour": none
Browser log
for case 1 in "Actual behaviour":

for case 2 in "Actual behaviour":

for case 3 in "Actual behaviour":

for case 4 in "Actual behaviour":

Steps to reproduce
#or a question-mark?Expected behaviour
file renamed correctly
Actual behaviour
#/?before the rename and the resulting filename is different to the source filename when you strip away anything after the#/?(e.g. renamefile=>file2#123): the UI shows the correct new filename but after a reload you see that the problematic char#/?got striped away silently from the name#/?`` before the rename and the resulting filename is same as source filename when you strip away anything after the#/?(e.g. renamefile=>file#123): an error is displayedThe name "file#123" is already used in the folder "/". Please choose a different name.`#/?before the rename and the new name only changes characters after the problematic char#/?(eg. renamefile#tofile#.txt: an error is displayedCould not rename "file#"#/?before the rename and the new name only changes characters before the hash#(eg. renamefile#tofile2#: the UI shows the correct new filename but after a reload you see that the problematic char#/?got striped away silently from the name. This is why UI tests fail withIssue started from #28732
Server configuration
Operating system:
Debian
Web server:
Apache
Database:
SQlite
PHP version:
7.1.6
ownCloud version: (see ownCloud admin page)
git master
Updated from an older ownCloud or fresh install:
fresh
Where did you install ownCloud from:
git
Client configuration
Browser:
FF 55, Chrome 60
Operating system:
Debian
ownCloud log (data/owncloud.log)
for case 1 in "Actual behaviour": none
for case 2 in "Actual behaviour":
for case 3 in "Actual behaviour":
for case 4 in "Actual behaviour": none
Browser log
for case 1 in "Actual behaviour":


for case 2 in "Actual behaviour":
for case 3 in "Actual behaviour":
for case 4 in "Actual behaviour":