From bfc0f85bc1869f5139505dd6ffbacecb1af564a4 Mon Sep 17 00:00:00 2001 From: rich Date: Mon, 25 Oct 2004 07:44:55 +0000 Subject: [PATCH] Fix for crashing bug: When one user hits "cancel" on a page which another user has edited. --- Makefile.config | 4 ++-- debian/changelog | 2 +- scripts/edit.ml | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Makefile.config b/Makefile.config index a72eabd..5e2a3ce 100644 --- a/Makefile.config +++ b/Makefile.config @@ -1,7 +1,7 @@ -# $Id: Makefile.config,v 1.13 2004/10/24 19:26:12 rich Exp $ +# $Id: Makefile.config,v 1.14 2004/10/25 07:44:55 rich Exp $ PACKAGE := cocanwiki -VERSION := 1.3.3 +VERSION := 1.3.4 # Normally ignored. However, if you are installing centrally (using # 'make pkg-install'), then the components are installed in the diff --git a/debian/changelog b/debian/changelog index 174f60d..76550d5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -cocanwiki (1.3.3-1) unstable; urgency=low +cocanwiki (1.3.4-1) unstable; urgency=low * Initial Release. diff --git a/scripts/edit.ml b/scripts/edit.ml index af885a1..abf8e3c 100644 --- a/scripts/edit.ml +++ b/scripts/edit.ml @@ -1,7 +1,7 @@ (* COCANWIKI - a wiki written in Objective CAML. * Written by Richard W.M. Jones . * Copyright (C) 2004 Merjis Ltd. - * $Id: edit.ml,v 1.21 2004/10/21 19:54:29 rich Exp $ + * $Id: edit.ml,v 1.22 2004/10/25 07:44:55 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 @@ -442,7 +442,8 @@ let run r (q : cgi) (dbh : Dbi.connection) hostid {hostname = hostname} user = let cancel id = let url = if id <> 0 then ( - let sth = dbh#prepare_cached "select url from pages + let sth = dbh#prepare_cached "select coalesce (url, url_deleted) + from pages where hostid = ? and id = ?" in sth#execute [`Int hostid; `Int id]; sth#fetch1string () -- 1.8.3.1