Skip to content

Conversation

@MorrisJobke
Copy link
Member

realpath() returns false in case the directory does not exist. Found it while preparing strict_typing for PHP7+. (#7392)

@MorrisJobke MorrisJobke added the 3. to review Waiting for reviews label Jan 12, 2018
@MorrisJobke MorrisJobke added this to the Nextcloud 14 milestone Jan 12, 2018
protected function findMigrations() {
$directory = realpath($this->migrationsPath);
if (!file_exists($directory) || !is_dir($directory)) {
if ($directory === false || !file_exists($directory) || !is_dir($directory)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm unsure if we should drop then the file_exists() call or if we want to have this sanity check still available.

Copy link
Member

Choose a reason for hiding this comment

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

Just leave it. Doesn't hurt to check.

@MorrisJobke MorrisJobke added 4. to release Ready to be released and/or waiting for tests to finish and removed 3. to review Waiting for reviews labels Jan 12, 2018
realpath() returns false in case the directory does not exist. Found it while preparing strict_typing for PHP7+.

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
@rullzer rullzer force-pushed the check-if-realpath-returns-false branch from ee3469e to 1efde41 Compare January 12, 2018 18:40
@codecov
Copy link

codecov bot commented Jan 12, 2018

Codecov Report

Merging #7822 into master will decrease coverage by 16.47%.
The diff coverage is 100%.

@@              Coverage Diff              @@
##             master    #7822       +/-   ##
=============================================
- Coverage     51.23%   34.75%   -16.48%     
+ Complexity    24973    24972        -1     
=============================================
  Files          1607     1607               
  Lines         95008    95008               
  Branches       1376     1376               
=============================================
- Hits          48674    33019    -15655     
- Misses        46334    61989    +15655
Impacted Files Coverage Δ Complexity Δ
lib/private/DB/MigrationService.php 24.11% <100%> (-46.1%) 53 <0> (+1)
...ivate/IntegrityCheck/Helpers/EnvironmentHelper.php 0% <0%> (-100%) 2% <0%> (ø)
lib/private/Files/ObjectStore/Mapper.php 0% <0%> (-100%) 2% <0%> (ø)
...te/Authentication/Token/DefaultTokenCleanupJob.php 0% <0%> (-100%) 1% <0%> (ø)
lib/private/App/AppStore/Version/Version.php 0% <0%> (-100%) 3% <0%> (ø)
.../Contacts/ContactsMenu/Providers/EMailProvider.php 0% <0%> (-100%) 4% <0%> (ø)
core/Command/Background/Cron.php 0% <0%> (-100%) 1% <0%> (ø)
apps/user_ldap/lib/GroupPluginManager.php 0% <0%> (-100%) 17% <0%> (ø)
apps/files/appinfo/app.php 0% <0%> (-100%) 0% <0%> (ø)
apps/dav/lib/CalDAV/Activity/Setting/Calendar.php 0% <0%> (-100%) 8% <0%> (ø)
... and 519 more

@rullzer rullzer merged commit 3dc7d0f into master Jan 12, 2018
@rullzer rullzer deleted the check-if-realpath-returns-false branch January 12, 2018 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

4. to release Ready to be released and/or waiting for tests to finish

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants