Ad Widget

Collapse

PATCH: Convert Meta _GET And Meta _POST To Meta _REQUEST

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • James Wells
    Senior Member
    • Jun 2005
    • 664

    #1

    PATCH: Convert Meta _GET And Meta _POST To Meta _REQUEST

    Greetings,

    This patch is meant to lay the ground work for various efforts that are underway regarding the UI. It does this by converting the UI from using the $_GET and $_POST meta variables to $_REQUEST meta variables.

    This patch replaces all instances of $_GET with $_REQUEST. By changing the meta variable from _GET / _POST to _REQUEST, we are making it a bit easier to begin various porting efforts. Majority of CMS interface systems use the POST method by default, whereas the current Zabbix implementation uses the GET method. With this patch in place we can begin to standardize certain logic checks without having to worry about wether the HTML request uses a POST or GET method.

    From the end user's perspective there should be zero change with this patch, this is almost exclusively a PHP dev change.
    Attached Files
    Unofficial Zabbix Developer
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    Hi James,

    I like this patch. However I'm a bit worried about the following:

    - $_REQUEST has been introduced in PHP 4.1.0. Is it safe to assume that most of users ar on PHP >4.1.0?
    - does it work in Configuration of Images Screen?
    - does $_REQUEST's behaviour relies on any configuration parameters of php.ini?

    Thanks.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • James Wells
      Senior Member
      • Jun 2005
      • 664

      #3
      Originally posted by Alexei
      - $_REQUEST has been introduced in PHP 4.1.0. Is it safe to assume that most of users ar on PHP >4.1.0?
      I decided to go an double check this. As I understand from the documentation at the PHP site, $_GET, $_POST, and $_REQUEST were all added at roughly the same time;
      PHP: Variables from outside PHP - Manual

      I will look through the code again, but as I read the above, they would already require 4.1 in order to run the 1.1 Zabbix UI.

      - does it work in Configuration of Images Screen?
      While I didn't test the image configuration screen, I did test it in many other locations and it appears to work correctly. Will test the image configuration today, just in case.

      EDIT: Just tested this. Yes, it works correctly, however, I did just find a bug in the images section, but not from this patch. When you click on 'Change' from the Images configuration screen, you only have the options to add or delete, not update. Will write a patch to fix that today as well.

      - does $_REQUEST's behaviour relies on any configuration parameters of php.ini?
      I suspect you are worrying about the 'register_globals' config option. If I read the above listed URL, then no, there is no change needed as the $_GET / $_POST / $_REQUEST are all listed as what they call "Superglobals"
      Last edited by James Wells; 23-10-2005, 17:31.
      Unofficial Zabbix Developer

      Comment

      • Alexei
        Founder, CEO
        Zabbix Certified Trainer
        Zabbix Certified SpecialistZabbix Certified Professional
        • Sep 2004
        • 5654

        #4
        Thanks for the detailed response. I'll integrate this patch shortly.
        Alexei Vladishev
        Creator of Zabbix, Product manager
        New York | Tokyo | Riga
        My Twitter

        Comment

        • Alexei
          Founder, CEO
          Zabbix Certified Trainer
          Zabbix Certified SpecialistZabbix Certified Professional
          • Sep 2004
          • 5654

          #5
          Integrated

          The patch has been integrated. Thanks.
          Last edited by Alexei; 24-10-2005, 07:36.
          Alexei Vladishev
          Creator of Zabbix, Product manager
          New York | Tokyo | Riga
          My Twitter

          Comment

          Working...