responseFactory->createResponse(); foreach ($this->response->getHeader()->getHttpHeaders() as $name => $value) { $response = $response->withHeader($name, $value); } $filename = $this->config->getChangeLogFilePath(); /** * Read changelog. */ // Check if the file is available, some distributions remove these. if (! @is_readable($filename)) { return $response->write(sprintf( __('The %s file is not available on this system, please visit %s for more information.'), basename($filename), 'phpmyadmin.net', )); } // Test if the file is in a compressed format if (str_ends_with($filename, '.gz')) { ob_start(); readgzfile($filename); $changelog = ob_get_clean(); } else { $changelog = file_get_contents($filename); } /** * Whole changelog in variable. */ $changelog = htmlspecialchars((string) $changelog); $githubUrl = 'https://github.com/phpmyadmin/phpmyadmin/'; $faqUrl = 'https://docs.phpmyadmin.net/en/latest/faq.html'; preg_match_all('@\n\[(\d+\.\d+\.\d+)]: (' . $githubUrl . '\S+)@', $changelog, $matches, PREG_SET_ORDER); $releaseLinks = array_column($matches, 2, 1); $changelog = (string) preg_replace_callback( '/\n## \[(\d+\.\d+\.\d+)]/', static fn (array $matches): string => "\n## [" . $matches[1] . '](' . $releaseLinks[$matches[1]] . ')', $changelog, ); $replaces = [ '/# Changes in phpMyAdmin (\d+\.\d+)/' => '