MITLibraries / MITlibraries-parent

The parent theme for MIT Libraries on WordPress
https://libraries.mit.edu
GNU General Public License v3.0
1 stars 3 forks source link

Reference to super-global $_SERVER in functions.php #201

Open matt-bernhardt opened 7 years ago

matt-bernhardt commented 7 years ago

There are five references to the super-global $_SERVER variable. This is being flagged in CodeClimate by the PHPMD tool, saying:

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example: ::

  class Foo {
      public function bar() {
          $name = $_POST['foo'];
      }
  }

This is probably a good conversation to have with Hattie once she starts, as it may involve moving parts of the hours harvester on the server.

matt-bernhardt commented 6 years ago

This was improved by #238, but the issue still exists in shibboleth_eppn() near the bottom of the file.