diff --git a/lib/private/Setup.php b/lib/private/Setup.php index 8781127b30a..95a4032be32 100644 --- a/lib/private/Setup.php +++ b/lib/private/Setup.php @@ -185,10 +185,11 @@ class Setup { } } - if (\OC_Util::runningOnMac()) { + // Check if running directly on macOS (note: Linux containers on macOS will not trigger this) + if (PHP_OS_FAMILY === 'Darwin') { $errors[] = [ 'error' => $this->l10n->t( - 'Mac OS X is not supported and %s will not work properly on this platform. ' + 'macOS is not supported and %s will not work properly on this platform. ' . 'Use it at your own risk!', [$this->defaults->getProductName()] ), diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php index bdbe0d0f1e1..fd87537cec7 100644 --- a/lib/private/legacy/OC_Util.php +++ b/lib/private/legacy/OC_Util.php @@ -732,15 +732,6 @@ class OC_Util { } } - /** - * Checks whether the server is running on Mac OS X - * - * @return bool true if running on Mac OS X, false otherwise - */ - public static function runningOnMac() { - return (strtoupper(substr(PHP_OS, 0, 6)) === 'DARWIN'); - } - /** * Handles the case that there may not be a theme, then check if a "default" * theme exists and take that one diff --git a/tests/lib/Files/ViewTest.php b/tests/lib/Files/ViewTest.php index b9f6b1a7373..e7ce3ee9526 100644 --- a/tests/lib/Files/ViewTest.php +++ b/tests/lib/Files/ViewTest.php @@ -805,15 +805,11 @@ class ViewTest extends \Test\TestCase { $ds = DIRECTORY_SEPARATOR; /* * 4096 is the maximum path length in file_cache.path in *nix - * 1024 is the max path length in mac */ $folderName = 'abcdefghijklmnopqrstuvwxyz012345678901234567890123456789'; $tmpdirLength = strlen(Server::get(ITempManager::class)->getTemporaryFolder()); - if (\OC_Util::runningOnMac()) { - $depth = ((1024 - $tmpdirLength) / 57); - } else { - $depth = ((4000 - $tmpdirLength) / 57); - } + $depth = ((4000 - $tmpdirLength) / 57); + foreach (range(0, $depth - 1) as $i) { $longPath .= $ds . $folderName; $result = $rootView->mkdir($longPath);