0

I'm trying to fix a very old website (10+ years old) for a customer who had different websites made by the same developer at the time. In the code of this website, the variables that are passed through "$_GET" are immediatly referenced, something like this:

/* Code in the website */

if ($lng) {


/* What I would have expected */

$lng = isset($_GET["lng"]) ? $_GET["lng"] : "";

if ($lng) {

The code in the website stopped working after some updates, so I was wondering: how is it that it previously worked? Was there a php mod or was it a feature of php that has been deprecated?

I'm asking so that I can find a better way to solve this issue in other websites made with the same technology.

Drago96
  • 1,265
  • 10
  • 19
  • 1
    https://stackoverflow.com/questions/16706098/how-can-i-emulate-register-globals-in-php-5-4-or-newer – AbraCadaver Dec 23 '21 at 17:17
  • 1
    The concept comes from `register_globals`, which is explained in more detail in the linked duplicate. As a matter of (widely held) opinion, it's *good* that this no longer works in the given codebase. It shouldn't have been used in the first place. – David Dec 23 '21 at 17:17
  • Perfect, thank you very much, didn't know about it! And I agree, it was not a good idea... – Drago96 Dec 23 '21 at 18:51

0 Answers0