Skip to content

Commit

Permalink
Fix for deprecated features in PHP 8.1
Browse files Browse the repository at this point in the history
Deprecated: strpos(): Passing null to parameter #1 ($haystack) of type string

ref.  https://www.php.net/manual/en/migration81.deprecated.php#migration81.deprecated.core.null-not-nullable-internal
  • Loading branch information
metalefty committed Mar 7, 2024
1 parent 17dfb43 commit 783f996
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion inc/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ function getUserIP()
$forward = @$_SERVER['HTTP_X_FORWARDED_FOR'];
$remote = $_SERVER['REMOTE_ADDR'];

if(strpos($forward,','))
if($forward != null && strpos($forward,','))
{
$a = explode(',',$forward);
$forward = trim($a[0]);
Expand Down

0 comments on commit 783f996

Please sign in to comment.