com web/php: Parse page id even when .php is missing: include/errors.inc
| From: | Christoph Michael Becker | Date: | Fri, 18 Dec 2020 22:47:36 +0000 |
| Subject: | com web/php: Parse page id even when .php is missing: include/errors.inc | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-29020@lists.php.net to get a copy of this message | ||
Commit: 365cf2be8f722f9935c5c80e34577d5aba8a1d86
Author: Anna Filina <afilina@gmail.com> Fri, 18 Dec 2020 11:20:45 -0500
Committer: Christoph M. Becker <cmbecker69@gmx.de> Fri, 18 Dec 2020 23:47:36 +0100
Parents: c5530f2f50c9a81cc3c6caa04af5d3685c80766e
Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=365cf2be8f722f9935c5c80e34577d5aba8a1d86
Log:
Parse page id even when ..php is missing
Changed paths:
M include/errors.inc
Diff:
diff --git a/include/errors.inc b/include/errors.inc
index 4bd985566..d72963ae3 100644
--- a/include/errors.inc
+++ b/include/errors.inc
@@ -524,7 +524,7 @@ function get_legacy_manual_urls(string $uri): array
$filename = $_SERVER["DOCUMENT_ROOT"] . "/manual/legacyurls.json";
$pages_ids = json_decode(file_get_contents($filename), true);
$page_id = preg_replace_callback('/^manual\/.*\/(.*?)(\.php)?$/', function (array
$matches): string {
- if (count($matches) !== 3) {
+ if (count($matches) < 2) {
return '';
}
return $matches[1] ;