Skip to content

Commit

Permalink
Don't redirect when no db is selected during ajax requests
Browse files Browse the repository at this point in the history
  • Loading branch information
roccivic committed Oct 30, 2012
1 parent b56871c commit f0d15e3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion libraries/db_common.inc.php
Expand Up @@ -50,7 +50,16 @@
. PMA_generate_common_url('', '', '&')
. (isset($message) ? '&message=' . urlencode($message) : '') . '&reload=1';
if (! strlen($db) || ! $is_db) {
PMA_sendHeaderLocation($uri);
$response = PMA_Response::getInstance();
if ($response->isAjax()) {
$response->isSuccess(false);
$response->addJSON(
'message',
PMA_Message::error(__('No databases selected.'))
);
} else {
PMA_sendHeaderLocation($uri);
}
exit;
}
} // end if (ensures db exists)
Expand Down

0 comments on commit f0d15e3

Please sign in to comment.