• Resolved ejw773

    (@ejw773)


    I have not had a problem with your plugin yet, but I’ve been tracking down PHP 8 upgrade troubles with some other plugins due to “undefined constants” causing fatal errors. Example: $_SERVER[REQUEST_URI] throws a fatal error, as PHP 7 would implicitly convert REQUEST_URI to a constant, but PHP 8 won’t.

    I noticed your rafflepress-giveaway.php file has an occurrence, and I’ve seen $_SERVER[HTTP_HOST] in other files as well.

    Are you planning on changing these to $_SERVER[‘REQUEST_URI’] and $_SERVER[‘HTTP_HOST’] at some point?

    Thanks!

Viewing 1 replies (of 1 total)
  • Plugin Support franz1989

    (@franz1989)

    Hello @ejw773 The error might be from another plugin. We have checked rafflepress in a site with PHP 8 and it does not have such an error.

    The error you mentioned would be related to a syntax error where the other plugin authors have $_SERVER[REQUEST_URI] instead of $_SERVER[‘REQUEST_URI’] (with REQUEST_URI in single quotes). Without the single quotes, the web server sees a constant (which would be undefined) instead of an expected variable array

    RafflePress we’re using the correct syntax for calling the $_SERVER[‘REQUEST_URI’] web server array variable. It might be from another plugin.

    Thanks,

Viewing 1 replies (of 1 total)
  • The topic ‘Undefined Constants & PHP 8’ is closed to new replies.