| @@ -80,8 +80,14 @@ | ||
| 80 | 80 | array_pop($chunks); |
| 81 | 81 | |
| 82 | 82 | $backup->type->id = implode('_', $chunks); |
| 83 | 83 | |
| 84 | + if (empty($backup->type->id)) | |
| 85 | + { | |
| 86 | + // unexpected file format | |
| 87 | + return null; | |
| 88 | + } | |
| 89 | + | |
| 84 | 90 | // try to fetch the matching export type |
| 85 | 91 | $type = $this->getExportTypes($backup->type->id); |
| 86 | 92 | |
| 87 | 93 | if ($type) |
| @@ -185,9 +191,9 @@ | ||
| 185 | 191 | |
| 186 | 192 | try |
| 187 | 193 | { |
| 188 | 194 | // upload archive |
| 189 | - $resp = VikBooking::uploadFileFromRequest((array)$file, $dest, "/application\/[a-zA-Z0-9\-_.]*\bzip\b/"); | |
| 195 | + $resp = VikBooking::uploadFileFromRequest((array)$file, $dest, 'zip'); | |
| 190 | 196 | } |
| 191 | 197 | catch (Exception $e) |
| 192 | 198 | { |
| 193 | 199 | // catch error and register it within the model |