-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix comparisons in apps #4790
Fix comparisons in apps #4790
Conversation
@@ -147,7 +147,7 @@ public function put($data) { | |||
// compare expected and actual size | |||
if (isset($_SERVER['CONTENT_LENGTH']) && $_SERVER['REQUEST_METHOD'] === 'PUT') { | |||
$expected = $_SERVER['CONTENT_LENGTH']; | |||
if ($count != $expected) { | |||
if ($count !== $expected) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int + strings are compared, need to fix
@@ -410,7 +410,7 @@ private function createFileChunked($data) { | |||
if (isset ($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'PUT') { | |||
if (isset($_SERVER['CONTENT_LENGTH'])) { | |||
$expected = $_SERVER['CONTENT_LENGTH']; | |||
if ($bytesWritten != $expected) { | |||
if ($bytesWritten !== $expected) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int + strings are compared, need to fix
I would say this is not the best point in time to do stuff like that. 🙈 |
Yeah I just wanted to have one check passed, so we can run the general tests (info.xml, language and database), but maybe it's easier to add an option to only run those... |
ef202f3
to
145e3f5
Compare
Codecov Report
@@ Coverage Diff @@
## master #4790 +/- ##
============================================
- Coverage 57.06% 54.14% -2.92%
- Complexity 21017 22345 +1328
============================================
Files 1245 1380 +135
Lines 71040 85551 +14511
Branches 0 1329 +1329
============================================
+ Hits 40537 46323 +5786
- Misses 30503 39228 +8725
|
Rebased on current master. @nickvergessen Could you please fix the comments you have? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unit tests fail
apps/files_versions/lib/Storage.php
Outdated
@@ -161,7 +161,7 @@ private static function getVersionsSize($user) { | |||
* store a new version of a file. | |||
*/ | |||
public static function store($filename) { | |||
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') { | |||
if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comparing bool to string worked before, however this config is not documented anywhere.
@schiessle any idea what other values are and why it exists?
de1ba6e
to
622d80d
Compare
Rebased and fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works 👍 Code looks good
Needs a rebase... |
Signed-off-by: Joas Schilling <[email protected]>
Let me try. |
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
Signed-off-by: Joas Schilling <[email protected]>
622d80d
to
a209342
Compare
Rebased. |
Phan fail is unrelated? |
Correct - this is fixed in master. |
Found via #4767