#1003 (ok 3.4) Don't use redirects for error messages

fixed
None
1
2013-06-11
2007-02-10
No

Hi,

At the moment a redirect is used to display error messages. This means that a refresh (F5) doesn't work as expected. Please don't use redirects and make refresh work.
Especially in the case of "#2003 - Can't connect to MySQL server on 'localhost' (10061)"

Discussion

  • Dan

    Dan - 2007-04-29

    Logged In: YES
    user_id=1722172
    Originator: NO

    I changed the main error function to work as you described (see patch). I did this without altering error.php in case it is used other places that were not obvious

     
  • Dan

    Dan - 2007-04-29

    Logged In: YES
    user_id=1722172
    Originator: NO

    file did not attach: here is the svn diff

    Index: phpMyAdmin/libraries/core.lib.php

    --- phpMyAdmin/libraries/core.lib.php (revision 10331)
    +++ phpMyAdmin/libraries/core.lib.php (working copy)
    @@ -236,18 +236,19 @@

    // Displays the error message
    // (do not use & for parameters sent by header)
    - header('Location: error.php'
    - . '?lang=' . urlencode($GLOBALS['available_languages'][$GLOBALS['lang']][2])
    - . '&dir=' . urlencode($GLOBALS['text_dir'])
    - . '&type=' . urlencode($GLOBALS['strError'])
    - . '&error=' . urlencode($error_message));

    // on fatal errors it cannot hurt to always delete the current session
    if (isset($GLOBALS['session_name']) && isset($_COOKIE[$GLOBALS['session_name']])) {
    PMA_removeCookie($GLOBALS['session_name']);
    }
    -
    - exit;
    +
    + $_REQUEST['lang'] = $GLOBALS['available_languages'][$GLOBALS['lang']][2];
    + $_REQUEST['dir'] = $GLOBALS['text_dir'];
    + $_REQUEST['type'] = $GLOBALS['strError'];
    + $_REQUEST['error'] = $error_message;
    + require_once dirname(__FILE__)."/../error.php";
    +
    + exit(0);
    }

    /**

     
  • Marc Delisle

    Marc Delisle - 2007-06-11

    Logged In: YES
    user_id=210714
    Originator: NO

    Moved to Patches.

     
  • Marc Delisle

    Marc Delisle - 2008-10-04
    • status: open --> pending
     
  • Marc Delisle

    Marc Delisle - 2008-10-04

    Still needed for 3.0.0 ?

     
  • SourceForge Robot

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
  • SourceForge Robot

    • status: pending --> closed
     
  • Olaf van der Spek

    • status: closed --> open
     
  • Olaf van der Spek

    Yes. For example, when it can't load the MySQL(i) extension.

     
  • Olaf van der Spek

    Please?

     
  • Michal Čihař

    Michal Čihař - 2011-03-02

    I guess this is fixed in 3.4 as error.php is gone.

     
  • Michal Čihař

    Michal Čihař - 2011-03-02
    • priority: 5 --> 1
    • assigned_to: nobody --> nijel
    • summary: Don't use redirects for error messages --> (ok 3.4) Don't use redirects for error messages
     
  • Michal Čihař

    Michal Čihař - 2011-05-11
    • status: open --> closed
     
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed --> fixed
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks