From: Mark Wooding Date: Mon, 6 Jul 2015 11:34:33 +0000 (+0100) Subject: mason/pastebin/dhandler: Some small refactorings. X-Git-Url: https://git.distorted.org.uk/~mdw/odin-cgi/commitdiff_plain/f8e94fc635a944aa7292506bb689d994a3652bd6 mason/pastebin/dhandler: Some small refactorings. --- diff --git a/mason/pastebin/dhandler b/mason/pastebin/dhandler index 7014dca..7f6ea24 100644 --- a/mason/pastebin/dhandler +++ b/mason/pastebin/dhandler @@ -21,8 +21,8 @@ $r->content_type("text/plain; charset=utf8"); $m->print($old{content}); } else { - $m->comp("%show", tag => $tag, %old, - edit => $Odin::COOKIE{"odin-handoff.$tag"}); + $edit = $Odin::COOKIE{"odin-handoff.$tag"}; + $m->comp("%show", tag => $tag, edit => $edit, %old); } } else { if ($op eq "del") { @@ -30,8 +30,8 @@ set_handoff_cookie $tag, "nil", -max_age => 5; $m->redirect("$Odin::PASTEBIN/"); } else { - my $editp = Odin::update_pastebin $tag, $edit, %props; set_handoff_cookie $tag, $edit; + my $editp = Odin::update_pastebin $tag, $edit, %props; if ($editp) { $m->redirect("$Odin::PASTEBIN/$tag"); } else { $m->comp("%edit", tag => $tag, edit => $edit, %props); } }