From cc873ccaecf92e5a765af5eed8a5d6ed5cd1764b Mon Sep 17 00:00:00 2001 From: Josh Date: Tue, 2 Dec 2025 18:46:16 -0500 Subject: [PATCH] chore(legacy): deprecate OC_Util::runningOnMac() - Easy enough query directly these days; Only used in one spot anyhow - Updated the runningOnMac method to use PHP_OS_FAMILY just for clarity until we can remove the function entirely (same result; supported since PHP ~7.4). Signed-off-by: Josh --- lib/private/legacy/OC_Util.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php index bdbe0d0f1e1..6fa8ccfd9d6 100644 --- a/lib/private/legacy/OC_Util.php +++ b/lib/private/legacy/OC_Util.php @@ -733,12 +733,16 @@ class OC_Util { } /** - * Checks whether the server is running on Mac OS X + * Checks whether PHP is running directly on macOS. + * + * Note: In a Linux container, this will be false even on a macOS host + * (PHP just sees "Linux"). * * @return bool true if running on Mac OS X, false otherwise + * @deprecated 33.0.0 Query PHP_OS_FAMILY directly. */ public static function runningOnMac() { - return (strtoupper(substr(PHP_OS, 0, 6)) === 'DARWIN'); + return (PHP_OS_FAMILY === 'Darwin'); } /**