]> source.dussan.org Git - nextcloud-server.git/commitdiff
Compare result are already true/false
authorBart Visscher <bartv@thisnet.nl>
Sat, 17 Aug 2013 10:58:10 +0000 (12:58 +0200)
committerBart Visscher <bartv@thisnet.nl>
Sat, 17 Aug 2013 10:58:10 +0000 (12:58 +0200)
apps/files/ajax/download.php
apps/files/ajax/list.php
apps/files_encryption/settings-personal.php
apps/files_external/lib/amazons3.php
apps/files_external/lib/config.php
apps/files_external/lib/sftp.php
apps/files_sharing/public.php
settings/admin.php
settings/ajax/getlog.php

index b2bfd53506d66697482f645e1f40cb6e5bff298d..6a34cbe4ef1928ed9727bc2c8aa28afe5df97393 100644 (file)
@@ -39,4 +39,4 @@ if (!is_array($files_list)) {
        $files_list = array($files);
 }
 
-OC_Files::get($dir, $files_list, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
+OC_Files::get($dir, $files_list, $_SERVER['REQUEST_METHOD'] == 'HEAD');
index 878e4cb2159e70c5a9aa25935b5bc9043a28ab81..b2975790a10220dc4cd7fa5d60408942079767f5 100644 (file)
@@ -10,7 +10,7 @@ OCP\JSON::checkLoggedIn();
 
 // Load the files
 $dir = isset( $_GET['dir'] ) ? $_GET['dir'] : '';
-$doBreadcrumb = isset( $_GET['breadcrumb'] ) ? true : false;
+$doBreadcrumb = isset( $_GET['breadcrumb'] );
 $data = array();
 
 // Make breadcrumb
index fddc3ea5eee836494eeec89e41114a2a6de86278..589219f32ada5c05fcc112140861fe535ae62ce9 100644 (file)
@@ -16,7 +16,7 @@ $view = new \OC_FilesystemView('/');
 $util = new \OCA\Encryption\Util($view, $user);\r
 $session = new \OCA\Encryption\Session($view);\r
 \r
-$privateKeySet = ($session->getPrivateKey() !== false) ? true : false;\r
+$privateKeySet = $session->getPrivateKey() !== false;
 \r
 $recoveryAdminEnabled = OC_Appconfig::getValue('files_encryption', 'recoveryAdminEnabled');\r
 $recoveryEnabledForUser = $util->recoveryEnabledForUser();\r
index f4d1940b184140ad20e6b659a0cf1d790beacefd..9363a350e27ae7d4040a58277866302348a9f455 100644 (file)
@@ -79,7 +79,7 @@ class AmazonS3 extends \OC\Files\Storage\Common {
 
                $this->bucket = $params['bucket'];
                $scheme = ($params['use_ssl'] === 'false') ? 'http' : 'https';
-               $this->test = ( isset($params['test'])) ? true : false;
+               $this->test = isset($params['test']);
                $this->timeout = ( ! isset($params['timeout'])) ? 15 : $params['timeout'];
                $params['region'] = ( ! isset($params['region'])) ? 'eu-west-1' : $params['region'];
                $params['hostname'] = ( !isset($params['hostname'])) ? 's3.amazonaws.com' : $params['hostname'];
index 14e974d65caab802b7b3615cbdf3fa44283c71c7..1935740cd2e4a5748c4e1763cf73093885d26c58 100755 (executable)
@@ -418,9 +418,9 @@ class OC_Mount_Config {
        public static function checksmbclient() {
                if(function_exists('shell_exec')) {
                        $output=shell_exec('which smbclient');
-                       return (empty($output)?false:true);
+                       return !empty($output);
                }else{
-                       return(false);
+                       return false;
                }
        }
 
@@ -429,9 +429,9 @@ class OC_Mount_Config {
         */
        public static function checkphpftp() {
                if(function_exists('ftp_login')) {
-                       return(true);
+                       return true;
                }else{
-                       return(false);
+                       return false;
                }
        }
 
@@ -439,7 +439,7 @@ class OC_Mount_Config {
         * check if curl is installed
         */
        public static function checkcurl() {
-               return (function_exists('curl_init'));
+               return function_exists('curl_init');
        }
 
        /**
@@ -460,6 +460,6 @@ class OC_Mount_Config {
                        $txt.=$l->t('<b>Warning:</b> The Curl support in PHP is not enabled or installed. Mounting of ownCloud / WebDAV or GoogleDrive is not possible. Please ask your system administrator to install it.').'<br />';
                }
 
-               return($txt);
+               return $txt;
        }
 }
index 4fd360964631d652372d454d2097700d2b68d6cf..f7f329b8993783ec29b70fd07cd140c2e17217a6 100644 (file)
@@ -170,7 +170,7 @@ class SFTP extends \OC\Files\Storage\Common {
 
        public function file_exists($path) {
                try {
-                       return $this->client->stat($this->abs_path($path)) === false ? false : true;
+                       return $this->client->stat($this->abs_path($path)) !== false;
                } catch (\Exception $e) {
                        return false;
                }
index 741ab145384b3d2745613cab1b26001156809632..6dfe8a4bc009e8fc2642b84f2a246a7e0bcb45ae 100644 (file)
@@ -112,9 +112,9 @@ if (isset($path)) {
                        if ($files_list === NULL ) {
                                $files_list = array($files);
                        }
-                       OC_Files::get($path, $files_list, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
+                       OC_Files::get($path, $files_list, $_SERVER['REQUEST_METHOD'] == 'HEAD');
                } else {
-                       OC_Files::get($dir, $file, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false);
+                       OC_Files::get($dir, $file, $_SERVER['REQUEST_METHOD'] == 'HEAD');
                }
                exit();
        } else {
@@ -133,7 +133,7 @@ if (isset($path)) {
                $tmpl->assign('mimetype', \OC\Files\Filesystem::getMimeType($path));
                $tmpl->assign('fileTarget', basename($linkItem['file_target']));
                $tmpl->assign('dirToken', $linkItem['token']);
-               $allowPublicUploadEnabled = (($linkItem['permissions'] & OCP\PERMISSION_CREATE) ? true : false );
+               $allowPublicUploadEnabled = ($linkItem['permissions'] & OCP\PERMISSION_CREATE) !== 0;
                if (\OCP\App::isEnabled('files_encryption')) {
                        $allowPublicUploadEnabled = false;
                }
index 10e239204f28cd55fec87c185167379d0ec9cf1b..6c01d4007defe764cb48e6d2f605f5b43d73b095 100755 (executable)
@@ -18,7 +18,7 @@ $forms=OC_App::getForms('admin');
 $htaccessworking=OC_Util::ishtaccessworking();
 
 $entries=OC_Log_Owncloud::getEntries(3);
-$entriesremain=(count(OC_Log_Owncloud::getEntries(4)) > 3)?true:false;
+$entriesremain=count(OC_Log_Owncloud::getEntries(4)) > 3;
 
 $tmpl->assign('loglevel', OC_Config::getValue( "loglevel", 2 ));
 $tmpl->assign('entries', $entries);
index e71514192860009286f4189b335cfdd45fe0299c..f160512b6ada17e9cab625c10615262ece61fec7 100644 (file)
@@ -16,6 +16,6 @@ $data = array();
 OC_JSON::success(
        array(
                "data" => $entries,
-               "remain"=>(count(OC_Log_Owncloud::getEntries(1, $offset + $count)) !== 0) ? true : false
+               "remain"=>count(OC_Log_Owncloud::getEntries(1, $offset + $count)) !== 0
        )
 );