aboutsummaryrefslogtreecommitdiff
path: root/www/edit.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/edit.php')
-rw-r--r--www/edit.php14
1 files changed, 9 insertions, 5 deletions
diff --git a/www/edit.php b/www/edit.php
index e95ca3f..33b22c2 100644
--- a/www/edit.php
+++ b/www/edit.php
@@ -9,16 +9,20 @@ require_once 'www-header.php';
$repo = new Repository();
$repo->loadFromRequest();
-$repopo = new Repository_Post($repo);
-if ($repopo->process($_POST, $_SESSION)) {
- redirect($repo->getLink('display', null, true));
-}
-
$file = null;
if (isset($_GET['file'])) {
$file = $repo->getFileByName($_GET['file']);
}
+$repopo = new Repository_Post($repo);
+if ($repopo->process($_POST, $_SESSION)) {
+ $anchor = '';
+ if ($file !== null) {
+ $anchor = '#' . $file->getAnchorName();
+ }
+ redirect($repo->getLink('display', null, true) . $anchor);
+}
+
render(
'edit',
array(