Skip to content

Trim path in changeLock - #16955

Merged
PVince81 merged 1 commit into
masterfrom
lock-changelocktrimpath
Jun 16, 2015
Merged

PVince81 merged 1 commit into
masterfrom
lock-changelocktrimpath

Conversation

@PVince81

Copy link
Copy Markdown
Contributor

Fixes #16896

@icewind1991 @SergioBertolinSG

  • TODO: add unit test

@ghost

ghost commented Jun 16, 2015

Copy link
Copy Markdown

💣 Test FAILed. 💣
nooo432

@PVince81 PVince81 added this to the 8.1-current milestone Jun 16, 2015
@nickvergessen

Copy link
Copy Markdown
Contributor

mind changing $path = rtrim($path, '/'); in unlockFile as well?
I think it would be nice if they are all the same.

Will have a look at that and unit tests after lunch.

@PVince81

Copy link
Copy Markdown
Contributor Author

I changed the approach, please have a look.

Need to take some time to fix the new unit test

@icewind1991

Copy link
Copy Markdown
Contributor

I dont think we need it in unlockPath/lockPath since those are called from (un)lockFile where that path is already normalized

👍 otherwise

@ghost

ghost commented Jun 16, 2015

Copy link
Copy Markdown

💣 Test FAILed. 💣
nooo432

@PVince81

Copy link
Copy Markdown
Contributor Author

I dont think we need it in unlockPath/lockPath since those are called from (un)lockFile where that path is already normalized

That's what I thought at first, but then I thought what happens if someone suddenly decides to call these functions directly... so decided to be defensive here.

Comment thread tests/lib/files/view.php

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test without leading slash as well?

@nickvergessen

Copy link
Copy Markdown
Contributor

That's what I thought at first, but then I thought what happens if someone suddenly decides to call these functions directly... so decided to be defensive here.

I had the same thoughts when I introduced the shouldLockFile method ;)

@PVince81

Copy link
Copy Markdown
Contributor Author

Will fix the unit tests to get this merged, seems this PR blocks a lot of things.

@PVince81
PVince81 force-pushed the lock-changelocktrimpath branch from 6872556 to 4f81341 Compare June 16, 2015 14:46
@PVince81

Copy link
Copy Markdown
Contributor Author

I fixed the tests then squashed. Please rereview

@nickvergessen

Copy link
Copy Markdown
Contributor

Needs rebase due to the other PR we merged?

@PVince81
PVince81 force-pushed the lock-changelocktrimpath branch from 4f81341 to 102c6ff Compare June 16, 2015 15:03
@scrutinizer-notifier

Copy link
Copy Markdown

A new inspection was created.

@PVince81

Copy link
Copy Markdown
Contributor Author

Rebased again.

@nickvergessen told me he approved this PR, counting as 👍

@ghost

ghost commented Jun 16, 2015

Copy link
Copy Markdown

💣 Test FAILed. 💣
nooo432

@PVince81

Copy link
Copy Markdown
Contributor Author

Here we go again, Jenkins PR #16971

@ghost

ghost commented Jun 16, 2015

Copy link
Copy Markdown

💣 Test FAILed. 💣
nooo432

PVince81 pushed a commit that referenced this pull request Jun 16, 2015
@PVince81
PVince81 merged commit de5c845 into master Jun 16, 2015
@PVince81
PVince81 deleted the lock-changelocktrimpath branch June 16, 2015 16:18
@lock lock Bot locked as resolved and limited conversation to collaborators Aug 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Experimental files locking] Uploading files from a federated server to a locked folder returns 500

4 participants