@@ -83,17 +83,23 @@ |
||
| 83 | 83 | <div id="preview"> |
| 84 | 84 | <?php if (isset($_['folder'])): ?> |
| 85 | 85 | <?php print_unescaped($_['folder']); ?> |
| 86 | - <?php else: ?> |
|
| 86 | + <?php else { |
|
| 87 | + : ?> |
|
| 87 | 88 | <?php if ($_['previewEnabled'] && substr($_['mimetype'], 0, strpos($_['mimetype'], '/')) == 'video'): ?> |
| 88 | 89 | <div id="imgframe"> |
| 89 | - <video tabindex="0" controls="" preload="none" style="max-width: <?php p($_['previewMaxX']); ?>px; max-height: <?php p($_['previewMaxY']); ?>px"> |
|
| 90 | + <video tabindex="0" controls="" preload="none" style="max-width: <?php p($_['previewMaxX']); |
|
| 91 | +} |
|
| 92 | +?>px; max-height: <?php p($_['previewMaxY']); ?>px"> |
|
| 90 | 93 | <source src="<?php p($_['downloadURL']); ?>" type="<?php p($_['mimetype']); ?>" /> |
| 91 | 94 | </video> |
| 92 | 95 | </div> |
| 93 | - <?php else: ?> |
|
| 96 | + <?php else { |
|
| 97 | + : ?> |
|
| 94 | 98 | <!-- Preview frame is filled via JS to support SVG images for modern browsers --> |
| 95 | 99 | <div id="imgframe"></div> |
| 96 | - <?php endif; ?> |
|
| 100 | + <?php endif; |
|
| 101 | +} |
|
| 102 | +?> |
|
| 97 | 103 | <div class="directDownload"> |
| 98 | 104 | <a href="<?php p($_['downloadURL']); ?>" id="downloadFile" class="button"> |
| 99 | 105 | <img class="svg" alt="" src="<?php print_unescaped(image_path("core", "actions/download.svg")); ?>"/> |
@@ -405,7 +405,7 @@ |
||
| 405 | 405 | $code = $e->getCode() === 0 ? 403 : $e->getCode(); |
| 406 | 406 | $share->getNode()->unlock(ILockingProvider::LOCK_SHARED); |
| 407 | 407 | return new \OC_OCS_Result(null, $code, $e->getHint()); |
| 408 | - }catch (\Exception $e) { |
|
| 408 | + } catch (\Exception $e) { |
|
| 409 | 409 | $share->getNode()->unlock(ILockingProvider::LOCK_SHARED); |
| 410 | 410 | return new \OC_OCS_Result(null, 403, $e->getMessage()); |
| 411 | 411 | } |
@@ -246,7 +246,9 @@ |
||
| 246 | 246 | function httpGet(RequestInterface $request, ResponseInterface $response) { |
| 247 | 247 | // Only handle valid files |
| 248 | 248 | $node = $this->tree->getNodeForPath($request->getPath()); |
| 249 | - if (!($node instanceof IFile)) return; |
|
| 249 | + if (!($node instanceof IFile)) { |
|
| 250 | + return; |
|
| 251 | + } |
|
| 250 | 252 | |
| 251 | 253 | // adds a 'Content-Disposition: attachment' header |
| 252 | 254 | if ($this->downloadAttachment) { |
@@ -53,7 +53,9 @@ |
||
| 53 | 53 | function getCurrentUserPrincipals() { |
| 54 | 54 | $principalV2 = $this->getCurrentUserPrincipal(); |
| 55 | 55 | |
| 56 | - if (is_null($principalV2)) return []; |
|
| 56 | + if (is_null($principalV2)) { |
|
| 57 | + return []; |
|
| 58 | + } |
|
| 57 | 59 | |
| 58 | 60 | $principalV1 = $this->convertPrincipal($principalV2, false); |
| 59 | 61 | return array_merge( |
@@ -53,8 +53,7 @@ |
||
| 53 | 53 | if (isset($arguments['legacy']) && $arguments['legacy']) { |
| 54 | 54 | // legacy home id (<= 5.0.12) |
| 55 | 55 | $this->id = 'local::' . $datadir . '/'; |
| 56 | - } |
|
| 57 | - else { |
|
| 56 | + } else { |
|
| 58 | 57 | $this->id = 'home::' . $this->user->getUID(); |
| 59 | 58 | } |
| 60 | 59 | |
@@ -50,7 +50,9 @@ discard block |
||
| 50 | 50 | public function stream_open($path, $mode, $options, &$opened_path) { |
| 51 | 51 | switch ($mode[0]) { |
| 52 | 52 | case 'r': |
| 53 | - if (!isset(self::$data[$path])) return false; |
|
| 53 | + if (!isset(self::$data[$path])) { |
|
| 54 | + return false; |
|
| 55 | + } |
|
| 54 | 56 | $this->path = $path; |
| 55 | 57 | $this->writable = isset($mode[1]) && $mode[1] == '+'; |
| 56 | 58 | break; |
@@ -60,18 +62,24 @@ discard block |
||
| 60 | 62 | $this->writable = true; |
| 61 | 63 | break; |
| 62 | 64 | case 'a': |
| 63 | - if (!isset(self::$data[$path])) self::$data[$path] = ''; |
|
| 65 | + if (!isset(self::$data[$path])) { |
|
| 66 | + self::$data[$path] = ''; |
|
| 67 | + } |
|
| 64 | 68 | $this->path = $path; |
| 65 | 69 | $this->writable = true; |
| 66 | 70 | $this->pointer = strlen(self::$data[$path]); |
| 67 | 71 | break; |
| 68 | 72 | case 'x': |
| 69 | - if (isset(self::$data[$path])) return false; |
|
| 73 | + if (isset(self::$data[$path])) { |
|
| 74 | + return false; |
|
| 75 | + } |
|
| 70 | 76 | $this->path = $path; |
| 71 | 77 | $this->writable = true; |
| 72 | 78 | break; |
| 73 | 79 | case 'c': |
| 74 | - if (!isset(self::$data[$path])) self::$data[$path] = ''; |
|
| 80 | + if (!isset(self::$data[$path])) { |
|
| 81 | + self::$data[$path] = ''; |
|
| 82 | + } |
|
| 75 | 83 | $this->path = $path; |
| 76 | 84 | $this->writable = true; |
| 77 | 85 | break; |
@@ -123,7 +131,9 @@ discard block |
||
| 123 | 131 | } |
| 124 | 132 | |
| 125 | 133 | public function stream_write($data) { |
| 126 | - if (!$this->writable) return 0; |
|
| 134 | + if (!$this->writable) { |
|
| 135 | + return 0; |
|
| 136 | + } |
|
| 127 | 137 | $size = strlen($data); |
| 128 | 138 | if ($this->stream_eof()) { |
| 129 | 139 | self::$data[$this->path] .= $data; |
@@ -450,11 +450,11 @@ discard block |
||
| 450 | 450 | $currentversion=OC_App::getAppVersion($app); |
| 451 | 451 | if (version_compare($ocsversion, $currentversion, '>')) { |
| 452 | 452 | return($ocsversion); |
| 453 | - }else{ |
|
| 453 | + } else{ |
|
| 454 | 454 | return false; |
| 455 | 455 | } |
| 456 | 456 | |
| 457 | - }else{ |
|
| 457 | + } else{ |
|
| 458 | 458 | return false; |
| 459 | 459 | } |
| 460 | 460 | |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | OC_Helper::rmdirr($appDir); |
| 503 | 503 | |
| 504 | 504 | return true; |
| 505 | - }else{ |
|
| 505 | + } else{ |
|
| 506 | 506 | \OCP\Util::writeLog('core', 'can\'t remove app '.$appId.'. It is not installed.', \OCP\Util::ERROR); |
| 507 | 507 | |
| 508 | 508 | return false; |
@@ -187,8 +187,7 @@ discard block |
||
| 187 | 187 | if ($this->fixLegacyStorage($currentId, (int)$row['numeric_id'])) { |
| 188 | 188 | $count++; |
| 189 | 189 | } |
| 190 | - } |
|
| 191 | - catch (RepairException $e) { |
|
| 190 | + } catch (RepairException $e) { |
|
| 192 | 191 | $hasWarnings = true; |
| 193 | 192 | $out->warning('Could not repair legacy storage ' . $currentId . ' automatically.'); |
| 194 | 193 | } |
@@ -230,8 +229,7 @@ discard block |
||
| 230 | 229 | if (!is_null($numericId) && $this->fixLegacyStorage($storageId, (int)$numericId)) { |
| 231 | 230 | $count++; |
| 232 | 231 | } |
| 233 | - } |
|
| 234 | - catch (RepairException $e) { |
|
| 232 | + } catch (RepairException $e) { |
|
| 235 | 233 | $hasWarnings = true; |
| 236 | 234 | $out->warning('Could not repair legacy storage ' . $storageId . ' automatically.'); |
| 237 | 235 | } |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | $fh = \OC\Files\Filesystem::fopen($file, 'r'); |
| 80 | 80 | $this->addFileFromStream($fh, $internalDir . $filename, $filesize); |
| 81 | 81 | fclose($fh); |
| 82 | - }elseif(\OC\Files\Filesystem::is_dir($file)) { |
|
| 82 | + } elseif(\OC\Files\Filesystem::is_dir($file)) { |
|
| 83 | 83 | $this->addDirRecursive($file, $internalDir); |
| 84 | 84 | } |
| 85 | 85 | } |