@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | } else { |
| 66 | 66 | $url = OC::$server->getURLGenerator()->getAbsoluteURL(OC::$server->getURLGenerator()->linkTo('', 'public.php').'?service='.$service); |
| 67 | 67 | } |
| 68 | - return $url . (($add_slash && $service[strlen($service) - 1] != '/') ? '/' : ''); |
|
| 68 | + return $url.(($add_slash && $service[strlen($service) - 1] != '/') ? '/' : ''); |
|
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | /** |
@@ -115,18 +115,18 @@ discard block |
||
| 115 | 115 | return "?"; |
| 116 | 116 | } |
| 117 | 117 | if ($bytes < 1024) { |
| 118 | - return $bytes . "B"; |
|
| 118 | + return $bytes."B"; |
|
| 119 | 119 | } |
| 120 | 120 | $bytes = round($bytes / 1024, 1); |
| 121 | 121 | if ($bytes < 1024) { |
| 122 | - return $bytes . "K"; |
|
| 122 | + return $bytes."K"; |
|
| 123 | 123 | } |
| 124 | 124 | $bytes = round($bytes / 1024, 1); |
| 125 | 125 | if ($bytes < 1024) { |
| 126 | - return $bytes . "M"; |
|
| 126 | + return $bytes."M"; |
|
| 127 | 127 | } |
| 128 | 128 | $bytes = round($bytes / 1024, 1); |
| 129 | - return $bytes . "G"; |
|
| 129 | + return $bytes."G"; |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | /** |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | public static function computerFileSize($str) { |
| 142 | 142 | $str = strtolower($str); |
| 143 | 143 | if (is_numeric($str)) { |
| 144 | - return (float)$str; |
|
| 144 | + return (float) $str; |
|
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | $bytes_array = array( |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | 'p' => 1024 * 1024 * 1024 * 1024 * 1024, |
| 159 | 159 | ); |
| 160 | 160 | |
| 161 | - $bytes = (float)$str; |
|
| 161 | + $bytes = (float) $str; |
|
| 162 | 162 | |
| 163 | 163 | if (preg_match('#([kmgtp]?b?)$#si', $str, $matches) && !empty($bytes_array[$matches[1]])) { |
| 164 | 164 | $bytes *= $bytes_array[$matches[1]]; |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | } |
| 273 | 273 | foreach ($dirs as $dir) { |
| 274 | 274 | foreach ($exts as $ext) { |
| 275 | - if ($check_fn("$dir/$name" . $ext)) |
|
| 275 | + if ($check_fn("$dir/$name".$ext)) |
|
| 276 | 276 | return true; |
| 277 | 277 | } |
| 278 | 278 | } |
@@ -343,7 +343,7 @@ discard block |
||
| 343 | 343 | $ext = ''; |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | - $newpath = $path . '/' . $filename; |
|
| 346 | + $newpath = $path.'/'.$filename; |
|
| 347 | 347 | if ($view->file_exists($newpath)) { |
| 348 | 348 | if (preg_match_all('/\((\d+)\)/', $name, $matches, PREG_OFFSET_CAPTURE)) { |
| 349 | 349 | //Replace the last "(number)" with "(number+1)" |
@@ -359,11 +359,11 @@ discard block |
||
| 359 | 359 | do { |
| 360 | 360 | if ($offset) { |
| 361 | 361 | //Replace the last "(number)" with "(number+1)" |
| 362 | - $newname = substr_replace($name, '(' . $counter . ')', $offset, $match_length); |
|
| 362 | + $newname = substr_replace($name, '('.$counter.')', $offset, $match_length); |
|
| 363 | 363 | } else { |
| 364 | - $newname = $name . ' (' . $counter . ')'; |
|
| 364 | + $newname = $name.' ('.$counter.')'; |
|
| 365 | 365 | } |
| 366 | - $newpath = $path . '/' . $newname . $ext; |
|
| 366 | + $newpath = $path.'/'.$newname.$ext; |
|
| 367 | 367 | $counter++; |
| 368 | 368 | } while ($view->file_exists($newpath)); |
| 369 | 369 | } |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | * @return int number of bytes representing |
| 427 | 427 | */ |
| 428 | 428 | public static function maxUploadFilesize($dir, $freeSpace = null) { |
| 429 | - if (is_null($freeSpace) || $freeSpace < 0){ |
|
| 429 | + if (is_null($freeSpace) || $freeSpace < 0) { |
|
| 430 | 430 | $freeSpace = self::freeSpace($dir); |
| 431 | 431 | } |
| 432 | 432 | return min($freeSpace, self::uploadLimit()); |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | $freeSpace = max($freeSpace, 0); |
| 445 | 445 | return $freeSpace; |
| 446 | 446 | } else { |
| 447 | - return (INF > 0)? INF: PHP_INT_MAX; // work around https://bugs.php.net/bug.php?id=69188 |
|
| 447 | + return (INF > 0) ? INF: PHP_INT_MAX; // work around https://bugs.php.net/bug.php?id=69188 |
|
| 448 | 448 | } |
| 449 | 449 | } |
| 450 | 450 | |
@@ -457,9 +457,9 @@ discard block |
||
| 457 | 457 | $ini = \OC::$server->getIniWrapper(); |
| 458 | 458 | $upload_max_filesize = OCP\Util::computerFileSize($ini->get('upload_max_filesize')); |
| 459 | 459 | $post_max_size = OCP\Util::computerFileSize($ini->get('post_max_size')); |
| 460 | - if ((int)$upload_max_filesize === 0 and (int)$post_max_size === 0) { |
|
| 460 | + if ((int) $upload_max_filesize === 0 and (int) $post_max_size === 0) { |
|
| 461 | 461 | return INF; |
| 462 | - } elseif ((int)$upload_max_filesize === 0 or (int)$post_max_size === 0) { |
|
| 462 | + } elseif ((int) $upload_max_filesize === 0 or (int) $post_max_size === 0) { |
|
| 463 | 463 | return max($upload_max_filesize, $post_max_size); //only the non 0 value counts |
| 464 | 464 | } else { |
| 465 | 465 | return min($upload_max_filesize, $post_max_size); |
@@ -586,7 +586,7 @@ discard block |
||
| 586 | 586 | $ownerId = $storage->getOwner($path); |
| 587 | 587 | $ownerDisplayName = ''; |
| 588 | 588 | $owner = \OC::$server->getUserManager()->get($ownerId); |
| 589 | - if($owner) { |
|
| 589 | + if ($owner) { |
|
| 590 | 590 | $ownerDisplayName = $owner->getDisplayName(); |
| 591 | 591 | } |
| 592 | 592 | |