From: root Date: Wed, 23 Aug 2017 16:20:09 +0000 (+0100) Subject: www/dbq/dbq.php X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=27b1c221e31d943a5908432192b1fad3b7fc269b;p=nb.git www/dbq/dbq.php --- 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);