summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@owncloud.com>2014-01-07 13:50:57 +0100
committerAndreas Fischer <bantu@owncloud.com>2014-05-29 16:17:13 +0200
commit3f8f8027d25ab39283d0ab13afcf7252dde8f240 (patch)
tree56eea480f6d3d4f2398ab48151cba9816355c92f /lib
parent6195f13bda086b242cbcdbff86260a81bf6163c9 (diff)
downloadnextcloud-server-3f8f8027d25ab39283d0ab13afcf7252dde8f240.tar.gz
nextcloud-server-3f8f8027d25ab39283d0ab13afcf7252dde8f240.zip
Cast to numeric instead of float, i.e. use an integer if possible.
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/storage/local.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/private/files/storage/local.php b/lib/private/files/storage/local.php
index fc2a590f6c8..7fa748a7fd7 100644
--- a/lib/private/files/storage/local.php
+++ b/lib/private/files/storage/local.php
@@ -224,7 +224,7 @@ if (\OC_Util::runningOnWindows()) {
/**
* @brief Tries to get the filesize via various workarounds if necessary.
* @param string $fullPath
- * @return mixed Number of bytes as float on success and workaround necessary, null otherwise.
+ * @return mixed Number of bytes on success and workaround necessary, null otherwise.
*/
private static function getFileSizeWithTricks($fullPath) {
if (PHP_INT_SIZE === 4) {
@@ -249,7 +249,7 @@ if (\OC_Util::runningOnWindows()) {
/**
* @brief Tries to get the filesize via a CURL HEAD request.
* @param string $fullPath
- * @return mixed Number of bytes as float on success, null otherwise.
+ * @return mixed Number of bytes on success, null otherwise.
*/
private static function getFileSizeFromCurl($fullPath) {
if (function_exists('curl_init')) {
@@ -263,7 +263,7 @@ if (\OC_Util::runningOnWindows()) {
$matches = array();
preg_match('/Content-Length: (\d+)/', $data, $matches);
if (isset($matches[1])) {
- return (float) $matches[1];
+ return 0 + $matches[1];
}
}
}
@@ -274,7 +274,7 @@ if (\OC_Util::runningOnWindows()) {
/**
* @brief Tries to get the filesize via COM and exec().
* @param string $fullPath
- * @return mixed Number of bytes as float on success, null otherwise.
+ * @return mixed Number of bytes on success, null otherwise.
*/
private static function getFileSizeFromOS($fullPath) {
$name = strtolower(php_uname('s'));
@@ -287,11 +287,11 @@ if (\OC_Util::runningOnWindows()) {
}
} else if (strpos($name, 'bsd') !== false) {
if (\OC_Helper::is_function_enabled('exec')) {
- return (float)exec('stat -f %z ' . escapeshellarg($fullPath));
+ return 0 + exec('stat -f %z ' . escapeshellarg($fullPath));
}
} else if (strpos($name, 'linux') !== false) {
if (\OC_Helper::is_function_enabled('exec')) {
- return (float)exec('stat -c %s ' . escapeshellarg($fullPath));
+ return 0 + exec('stat -c %s ' . escapeshellarg($fullPath));
}
} else {
\OC_Log::write('core',