Osclass Support Forums
Osclass plugin support => User Rating Plugin => Topic started by: Tango on October 07, 2021, 02:19:55 PM
-
Hello,
I'm using the following code in rating.php to show the user IP:
$user_title .= __('IP', 'user_rating') . ': ' . $from_user['s_access_ip'];
It works fine, however on PHP 7.4, I'm getting the following notices:
PHP Notice: Undefined variable: from_user
PHP Notice: Trying to access array offset on value of type null
Any advice on how to fix this?
Thanks!
-
In some cases variable from_user is not defined
-
I tried using isset($from_user['s_access_ip']) and it fixes the notices but returns 1 instead of the actual IP...
-
Easiest (not best) is to place @ at start.
Your ussage of isset is wrong & wrong ::)