diff --git a/libraries/joomla/filesystem/path.php b/libraries/joomla/filesystem/path.php index a858efdc44c87..5cc6e44a45b7e 100644 --- a/libraries/joomla/filesystem/path.php +++ b/libraries/joomla/filesystem/path.php @@ -236,9 +236,17 @@ public static function isOwner($path) $jtp = JPATH_SITE . '/tmp'; // Try to find a writable directory - $dir = is_writable('/tmp') ? '/tmp' : false; - $dir = (!$dir && is_writable($ssp)) ? $ssp : false; - $dir = (!$dir && is_writable($jtp)) ? $jtp : false; + $dir = false; + + foreach (array($jtp, $ssp, '/tmp') as $currentDir) + { + if (is_writable($currentDir)) + { + $dir = $currentDir; + + break; + } + } if ($dir) {