diff --git a/src/Lms/Canvas/CanvasApi.php b/src/Lms/Canvas/CanvasApi.php index c901a7ce..3115407d 100644 --- a/src/Lms/Canvas/CanvasApi.php +++ b/src/Lms/Canvas/CanvasApi.php @@ -173,12 +173,8 @@ public function apiPut($url, $options) public function apiDelete($url) { $lmsResponse = new LmsResponse(); - if (strpos($url, 'https://') === false) { - $pattern = '/\/files\/\d+/'; - - preg_match($pattern, $url, $matches); - - $url = "https://" . $this->baseUrl . "/api/v1/" . $matches[0]; + if (strpos($url, 'https://') === false) { + $url = "https://{$this->baseUrl}/api/v1/{$url}"; } $response = $this->httpClient->request('DELETE', $url);