diff options
author | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2016-10-14 08:58:29 +0200 |
---|---|---|
committer | Benjamin Kellermann <Benjamin.Kellermann@gmx.de> | 2016-10-14 08:58:29 +0200 |
commit | 2f84860dd300d6da024666053c5ce5149122097f (patch) | |
tree | 59be59814486a46b44c398678aa606f21f4d69b4 /index.cgi | |
parent | af92765798574598edc29651fa306d8b2eb67004 (diff) |
bugfix: poll creation failed
Diffstat (limited to 'index.cgi')
-rwxr-xr-x | index.cgi | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 => "<br /><a href=\"#{POLLURL}\">#{POLLURL}</a>"} 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/" |