diff --git a/app/Module/ModuleCustomTrait.php b/app/Module/ModuleCustomTrait.php index c4fd1a8579c..82073705db0 100644 --- a/app/Module/ModuleCustomTrait.php +++ b/app/Module/ModuleCustomTrait.php @@ -68,6 +68,18 @@ public function customModuleLatestVersionUrl(): string return ''; } + /** + * Fetch the version information from the given content string. + * + * @param string $content + * + * @return string + */ + protected function extractVersion(string $content): string + { + return $content; + } + /** * Fetch the latest version of this module. * @@ -89,7 +101,7 @@ public function customModuleLatestVersion(): string $response = $client->get($this->customModuleLatestVersionUrl()); if ($response->getStatusCode() === StatusCodeInterface::STATUS_OK) { - $version = $response->getBody()->getContents(); + $version = $this->extractVersion($response->getBody()->getContents()); // Does the response look like a version? if (preg_match('/^\d+\.\d+\.\d+/', $version)) {