From 27b1c221e31d943a5908432192b1fad3b7fc269b Mon Sep 17 00:00:00 2001 From: root Date: Wed, 23 Aug 2017 17:20:09 +0100 Subject: [PATCH] www/dbq/dbq.php --- www/dbq/dbq.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index 73cb5231..d328c00d 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -963,7 +963,9 @@ EOF; } elseif ($action == 'update' and $this->perm >= self::WRITE) { if (!$this->table->update($_POST,$info)) $this->error('update: '.print_r($info,true)); - header('Location: '.$this->table->base.'/'); + # NB 23.08.17: TODO + $this->redirect_if_no_referer($this->table->base.'/'); + #header('Location: '.$this->table->base.'/'); $this->page($info); } elseif ($action == 'rm' and $this->perm >= self::DELETE) { @@ -978,6 +980,11 @@ EOF; } } + public function redirect_if_no_referer($url) { + if ($this->p('referer')) $url = urldecode($this->p('referer')); + header('Location: '.$url); + } + public function run() { #$this->bye($_POST); -- 2.47.3