ghwikipp: Fix recooking of pages that have a '.' in the name before the file extension.

From 20d22c0e1141ee06c801d96aba9f5d631c5a586d Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Tue, 17 Sep 2024 13:52:45 +0000
Subject: [PATCH] Fix recooking of pages that have a '.' in the name before the
 file extension.

Fixes #15.
---
 index.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/index.php b/index.php
index b810a63..637c03e 100644
--- a/index.php
+++ b/index.php
@@ -276,7 +276,7 @@ function recook_tree($rawbasedir, $cookedbasedir, $dir, &$updated)
         } else {
             $src = "$rawbasedir/$page";
             $dst = "$cookedbasedir/$page";
-            $dst = preg_replace('/\..*?$/', '.html', $dst);
+            $dst = preg_replace('/^(.*)\..*?$/', '$1.html', $dst);
             $srcmtime = filemtime($src);
             $dstmtime = @filemtime($dst);
             if (($srcmtime === false) || ($dstmtime === false) || ($srcmtime >= $dstmtime)) {