Fix the bug with unrecognised extension pages turning up as redlinks
authorrich <rich>
Mon, 14 Aug 2006 18:25:29 +0000 (18:25 +0000)
committerrich <rich>
Mon, 14 Aug 2006 18:25:29 +0000 (18:25 +0000)
in the superdirs.

scripts/page.ml

index 82fa0e7..68fb627 100644 (file)
@@ -1,7 +1,7 @@
 (* COCANWIKI - a wiki written in Objective CAML.
  * Written by Richard W.M. Jones <rich@merjis.com>.
  * Copyright (C) 2004 Merjis Ltd.
- * $Id: page.ml,v 1.55 2006/08/14 17:56:59 rich Exp $
+ * $Id: page.ml,v 1.56 2006/08/14 18:25:29 rich Exp $
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -221,7 +221,11 @@ let run r (q : cgi) dbh hostid
                  let url, redlink =
                    match Wikilib.generate_url_of_title r dbh hostid path with
                    | Wikilib.GenURL_Duplicate url -> url, None
-                   | Wikilib.GenURL_OK url -> url, Some path
+                   | Wikilib.GenURL_OK url ->
+                       (* Is it an extension page? *)
+                       (match get_extension url with
+                        | Some _ -> url, None (* extension page *)
+                        | None -> url, Some path (* redlink *))
                    | Wikilib.GenURL_BadURL | Wikilib.GenURL_TooShort ->
                        raise Exit in
                  pathsofar := path;