Menu

&db= at start of querystring results in 404

Help
adrianbj
2020-12-07
2021-02-08
  • adrianbj

    adrianbj - 2020-12-07

    This has been a problem for me all along so I hack the adminer core, changing:

    echo'<a href="'.h($A."&db=".urlencode(DB)
    

    to:

    echo'<a href="'.h($A."?db=".urlencode(DB)
    

    This might be because I am setting the available databases like this:

        function databases($flush = true) {
            return [$this->db];
        }
    

    so that there is only one database available.

    The way I get to the situation with the &db at the start of the querystring is to view a table and then click the DB name in the breadrumb in the header.

    Could this be fixed in the core please?

     
  • Jakub Vrána

    Jakub Vrána - 2021-02-07

    Adminer always has at least ?username= here. You must be doing something weird.

     
  • adrianbj

    adrianbj - 2021-02-08

    It's because I've been setting $_GET['username'] = "" which seemed to be part of the recommended way to set up an automatic login. Currently I am logging in automatically via a JS submission of a hidden form which is a bit ugly, but it works and does mean that I no longer need to set $_GET['username'] = "" and so there is now also no longer an issue with &db, so I guess this is solved.

     
  • Jakub Vrána

    Jakub Vrána - 2021-02-08

    Do not set $_GET["username"] in the constructor but just before including Adminer.

     
  • adrianbj

    adrianbj - 2021-02-08

    Thanks @jakubvrana - that fixed it :)

     

Log in to post a comment.