@@ -155,7 +155,7 @@ |
||
155 | 155 | { |
156 | 156 | $result = ''; |
157 | 157 | $filePath = parse_url($url, PHP_URL_PATH); |
158 | - $filePath = $_SERVER['DOCUMENT_ROOT'] . $filePath; |
|
158 | + $filePath = $_SERVER['DOCUMENT_ROOT'].$filePath; |
|
159 | 159 | if (file_exists($filePath)) { |
160 | 160 | $urlParams = [ |
161 | 161 | 'url' => $url, |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | $filePath = parse_url($url, PHP_URL_PATH); |
68 | 68 | // Remove any relative paths |
69 | 69 | if (!PathHelper::ensurePathIsContained($filePath)) { |
70 | - throw new BadRequestHttpException('Invalid resource path: ' . $filePath); |
|
70 | + throw new BadRequestHttpException('Invalid resource path: '.$filePath); |
|
71 | 71 | } |
72 | 72 | // Only work for `allowedFileExtensions` file extensions |
73 | 73 | $extension = strtolower(pathinfo($filePath, PATHINFO_EXTENSION)); |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | throw new AssetDisallowedExtensionException("File “{$filePath}” cannot be downloaded because “{$extension}” is not allowed."); |
77 | 77 | } |
78 | 78 | |
79 | - $filePath = $_SERVER['DOCUMENT_ROOT'] . $filePath; |
|
79 | + $filePath = $_SERVER['DOCUMENT_ROOT'].$filePath; |
|
80 | 80 | Craft::$app->getResponse()->sendFile( |
81 | 81 | $filePath, |
82 | 82 | null, |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | public function actionProgress($filename) |
101 | 101 | { |
102 | 102 | $result = []; |
103 | - $progressFile = sys_get_temp_dir() . DIRECTORY_SEPARATOR . $filename . '.progress'; |
|
103 | + $progressFile = sys_get_temp_dir().DIRECTORY_SEPARATOR.$filename.'.progress'; |
|
104 | 104 | if (file_exists($progressFile)) { |
105 | 105 | $content = @file_get_contents($progressFile); |
106 | 106 | if ($content) { |
@@ -111,12 +111,12 @@ discard block |
||
111 | 111 | |
112 | 112 | // rawDuration is in 00:00:00.00 format. This converts it to seconds. |
113 | 113 | $ar = array_reverse(explode(':', $rawDuration)); |
114 | - $duration = (float)$ar[0]; |
|
114 | + $duration = (float) $ar[0]; |
|
115 | 115 | if (!empty($ar[1])) { |
116 | - $duration += (int)$ar[1] * 60; |
|
116 | + $duration += (int) $ar[1] * 60; |
|
117 | 117 | } |
118 | 118 | if (!empty($ar[2])) { |
119 | - $duration += (int)$ar[2] * 60 * 60; |
|
119 | + $duration += (int) $ar[2] * 60 * 60; |
|
120 | 120 | } |
121 | 121 | } else { |
122 | 122 | $duration = 'unknown'; // with GIF as input, duration is unknown |
@@ -133,12 +133,12 @@ discard block |
||
133 | 133 | |
134 | 134 | //rawTime is in 00:00:00.00 format. This converts it to seconds. |
135 | 135 | $ar = array_reverse(explode(':', $rawTime)); |
136 | - $time = (float)$ar[0]; |
|
136 | + $time = (float) $ar[0]; |
|
137 | 137 | if (!empty($ar[1])) { |
138 | - $time += (int)$ar[1] * 60; |
|
138 | + $time += (int) $ar[1] * 60; |
|
139 | 139 | } |
140 | 140 | if (!empty($ar[2])) { |
141 | - $time += (int)$ar[2] * 60 * 60; |
|
141 | + $time += (int) $ar[2] * 60 * 60; |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | //calculate the progress |