#416 "Back" link from "Browse" leads to error

GIT
closed-fixed
General (123)
5
2012-02-28
2011-10-28
Anonymous
No

Notice: Undefined index: table in /var/www/html/pgadmin/tblproperties.php on line 461

Notice: Undefined index: table in /var/www/html/pgadmin/tblproperties.php on line 463

Notice: Undefined index: table in /var/www/html/pgadmin/tblproperties.php on line 465

Notice: Undefined index: table in /var/www/html/pgadmin/tblproperties.php on line 475

Notice: Undefined index: table in /var/www/html/pgadmin/tblproperties.php on line 544

Notice: Undefined index: table in /var/www/html/pgadmin/tblproperties.php on line 549

Notice: Undefined index: table in /var/www/html/pgadmin/tblproperties.php on line 554

Notice: Undefined index: table in /var/www/html/pgadmin/tblproperties.php on line 559

Notice: Undefined index: table in /var/www/html/pgadmin/tblproperties.php on line 564

Notice: Undefined index: table in /var/www/html/pgadmin/tblproperties.php on line 583

If you click on "Browse" again, you get this:

SQL error:

ERROR: relation "<br /><b>Notice</b>: Undefined index: table in <b>/var/www/ht" does not exist

In statement:

SELECT COUNT(*) AS total FROM (SELECT * FROM "<br /><b>Notice</b>: Undefined index: table in <b>/var/www/html/pgadmin/tblproperties.php</b> on line <b>572</b><br />") AS sub

Discussion

1 2 > >> (Page 1 of 2)
  • Arnaud Daret
    Arnaud Daret
    2011-11-04

    Replacing the line 581 in display.php

    echo "\t<li><a href=\"". htmlspecialchars($_REQUEST['return_url']) ."\">". htmlspecialchars($_REQUEST['return_desc']) ."</a></li>\n";

    By

    echo "\t<li><a href=\"". urldecode($_REQUEST['return_url']) ."\">". htmlspecialchars($_REQUEST['return_desc']) ."</a></li>\n";

    resolves the problem.

     
    • assigned_to: nobody --> ioguix
     
  • Hey,

    Thank you for the report, I found that bug as well, but hadn't time to fix it yet...

    I'll take care of that as soon as I find some time, but patch are welcome. The overall idea would be to drop the return_url parameter from the url itself...(put it in session ?)

     
  • Arnaud Daret
    Arnaud Daret
    2011-11-04

    So as you said, it may usefull (and more secure) to drop this return_url parameter and to rebuild url with session or simply with url query

     
  • Yes, rebuild the url based on some session variables...

    what you mean by simply "with url query" ?

     
  • Arnaud Daret
    Arnaud Daret
    2011-11-04

    URL query : I talk about the part of URL behind the "?" character

    To show a table from left tree, you click on
    http://localhost/phppgadmin/redirect.php?subject=table&server=localhost%3A5432%3Aallow&database=db_test&schema=public&table=storage_doc

    It gives you the table properties

    When you choose to browse the table rows, the return_url value in URL "return link" will be :
    tblproperties.php%3Fserver%3Dlocalhost%253A5432%253Aallow%26amp%3Bdatabase%3Dcamis_www%26amp%3Bschema%3Dpublic%26amp%3Btable%3Dstorage_doc

    All parameters contained into this return_url are allready known in the page (server, database, schema and table), so the return_url could be rebuild by getting current page url query parameters.

    But maybe there's another cases of "return_url" more difficult than this one...

     
  • "But maybe there's another cases of "return_url" more difficult than this
    one..."

    Indeed. When browsing, the return_url might point to the table properties, the column properties, the "select" page, the query form, ...and probably a bunch of some more...

     
  • Arnaud Daret
    Arnaud Daret
    2011-11-04

    Ok so another way keeping return_url may be :

    1) urldecode the return_url
    2) explode the string using "&amp;"
    3) array_map the result array using htmlspecialchars
    4) implode array using "&"

     
1 2 > >> (Page 1 of 2)