@@ -146,13 +146,13 @@ discard block |
||
| 146 | 146 | //Log import |
| 147 | 147 | Tracker::logActivity($username, $role, $study, $visitObject->id_visit, "Upload Series", $logDetails); |
| 148 | 148 | |
| 149 | - }catch (Throwable $e1) { |
|
| 149 | + } catch (Throwable $e1) { |
|
| 150 | 150 | error_log($e1->getMessage()); |
| 151 | 151 | handleException($e1); |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | |
| 155 | -}else { |
|
| 155 | +} else { |
|
| 156 | 156 | header('HTTP/1.0 403 Forbidden'); |
| 157 | 157 | die('You are not allowed to access this file.'); |
| 158 | 158 | } |
@@ -207,11 +207,11 @@ discard block |
||
| 207 | 207 | |
| 208 | 208 | if (count($importedMap) == 1 && $importedInstances == $nbOfInstances) { |
| 209 | 209 | return $importedMap; |
| 210 | - }else { |
|
| 210 | + } else { |
|
| 211 | 211 | //These error shall never occur |
| 212 | 212 | if (count($importedMap) > 1) { |
| 213 | 213 | throw new Exception("More than one study in Zip"); |
| 214 | - }else if ($importedInstances != $nbOfInstances) { |
|
| 214 | + } else if ($importedInstances != $nbOfInstances) { |
|
| 215 | 215 | throw new Exception("Imported DICOM not matching announced number of Instances"); |
| 216 | 216 | |
| 217 | 217 | } |
@@ -227,8 +227,11 @@ discard block |
||
| 227 | 227 | $it=new RecursiveDirectoryIterator($directory, FilesystemIterator::SKIP_DOTS); |
| 228 | 228 | $it=new RecursiveIteratorIterator($it, RecursiveIteratorIterator::CHILD_FIRST); |
| 229 | 229 | foreach ($it as $file) { |
| 230 | - if ($file->isDir()) rmdir($file->getPathname()); |
|
| 231 | - else unlink($file->getPathname()); |
|
| 230 | + if ($file->isDir()) { |
|
| 231 | + rmdir($file->getPathname()); |
|
| 232 | + } else { |
|
| 233 | + unlink($file->getPathname()); |
|
| 234 | + } |
|
| 232 | 235 | } |
| 233 | 236 | rmdir($directory); |
| 234 | 237 | } |