[Pkg-owncloud-commits] [owncloud] 122/199: Cast to numeric instead of float, i.e. use an integer if possible.
David Prévot
taffit at moszumanska.debian.org
Sun Jun 1 18:53:17 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository owncloud.
commit 3f8f8027d25ab39283d0ab13afcf7252dde8f240
Author: Andreas Fischer <bantu at owncloud.com>
Date: Tue Jan 7 13:50:57 2014 +0100
Cast to numeric instead of float, i.e. use an integer if possible.
---
lib/private/files/storage/local.php | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/lib/private/files/storage/local.php b/lib/private/files/storage/local.php
index fc2a590..7fa748a 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',
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list