Skip to content

Commit

Permalink
Remove duplicate checking of goto
Browse files Browse the repository at this point in the history
It's already done in common.inc.php, no need to check again here (and
the check was wrong anyway).

Signed-off-by: Michal Čihař <michal@cihar.com>
  • Loading branch information
nijel committed Dec 15, 2015
1 parent 0a20708 commit 605ce33
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions sql.php
Expand Up @@ -45,15 +45,8 @@
/**
* Defines the url to return to in case of error in a sql statement
*/
// Security checks
if (! empty($goto)) {
$is_gotofile = preg_replace('@^([^?]+).*$@s', '\\1', $goto);
if (! @file_exists('' . $is_gotofile)) {
unset($goto);
} else {
$is_gotofile = ($is_gotofile == $goto);
}
} else {
$is_gotofile = true;
if (empty($goto)) {
if (empty($table)) {
$goto = Util::getScriptNameForOption(
$GLOBALS['cfg']['DefaultTabDatabase'], 'database'
Expand All @@ -63,7 +56,6 @@
$GLOBALS['cfg']['DefaultTabTable'], 'table'
);
}
$is_gotofile = true;
} // end if

if (! isset($err_url)) {
Expand Down

0 comments on commit 605ce33

Please sign in to comment.