From 2f84860dd300d6da024666053c5ce5149122097f Mon Sep 17 00:00:00 2001 From: Benjamin Kellermann Date: Fri, 14 Oct 2016 08:58:29 +0200 Subject: bugfix: poll creation failed --- index.cgi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'index.cgi') diff --git a/index.cgi b/index.cgi index 5146b0b..09af72e 100755 --- a/index.cgi +++ b/index.cgi @@ -51,7 +51,6 @@ if $cgi.include?("create_poll") && $cgi.include?("poll_url") else Dir.mkdir(POLLURL) Dir.chdir(POLLURL) begin - Poll.new(CGI.escapeHTML(POLLTITLE),$cgi["poll_type"]) VCS.init File.symlink("../participate.rb","index.cgi") VCS.add("index.cgi") @@ -63,12 +62,16 @@ if $cgi.include?("create_poll") && $cgi.include?("poll_url") File.open(f,"w").close VCS.add(f) } + Poll.new(CGI.escapeHTML(POLLTITLE),$cgi["poll_type"]) Dir.chdir("..") $d.html.header["status"] = "REDIRECT" $d.html.header["Cache-Control"] = "no-cache" $d.html.header["Location"] = $conf.siteurl + POLLURL + "/edit_columns.cgi" $d << _("The poll was created successfully. The link to your new poll is: %{link}") % {:link => "
#{POLLURL}"} rescue WrongPollTypeError # should only happen in case of hacking + Dir.chdir("..") + require "fileutils" + FileUtils.rm_r(POLLURL) $d.html.header["status"] = "REDIRECT" $d.html.header["Cache-Control"] = "no-cache" $d.html.header["Location"] = "http://localhost/" -- cgit v1.2.3