diff options
| author | Christian Weiske <cweiske@cweiske.de> | 2012-03-30 07:54:14 +0200 |
|---|---|---|
| committer | Christian Weiske <cweiske@cweiske.de> | 2012-03-30 07:54:14 +0200 |
| commit | a3845de282299bd805d6455789bc6531bde861be (patch) | |
| tree | a68b03cc3c0633750cb213bd39d78c335224cd68 | |
| parent | c0550b6ba0b9a676d090986ae566243d29895747 (diff) | |
| download | phorkie-a3845de282299bd805d6455789bc6531bde861be.tar.gz phorkie-a3845de282299bd805d6455789bc6531bde861be.zip | |
forking only possible with POST requests now
| -rw-r--r-- | data/templates/display.htm | 4 | ||||
| -rw-r--r-- | www/fork.php | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/data/templates/display.htm b/data/templates/display.htm index 0b95912..ca52775 100644 --- a/data/templates/display.htm +++ b/data/templates/display.htm @@ -17,7 +17,9 @@ <h3>Paste #{{repo.id}}</h3> </div> <div class="span4" style="text-align: right"> - <a class="btn" href="{{repo.getLink('fork')}}"><i class="icon-share"></i> fork</a> + <form method="post" action="{{repo.getLink('fork')}}"> + <button type="submit" class="btn"><i class="icon-share"></i> fork</button> + </form> </div> </div> diff --git a/www/fork.php b/www/fork.php index 6bec5f0..f6ec95a 100644 --- a/www/fork.php +++ b/www/fork.php @@ -4,6 +4,11 @@ */ namespace Phorkie; require_once 'www-header.php'; + +if ($_SERVER['REQUEST_METHOD'] !== 'POST') { + throw new Exception_Input('Forking only possible via POST'); +} + $repo = new Repository(); $repo->loadFromRequest(); |
