Skip to content

Commit

Permalink
Merge pull request #2 from canonex/master
Browse files Browse the repository at this point in the history
Php 8.1 preg_match(): Passing null ... is deprecated
  • Loading branch information
ip2location authored Nov 21, 2022
2 parents bfa3369 + d383cb1 commit 1e96621
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ip2location-csv-converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
while (!feof($file)) {
$data = fgetcsv($file);

if (!preg_match('/^[0-9]+$/', $data[0]) || !preg_match('/^[0-9]+$/', $data[1])) {
if (!preg_match('/^[0-9]+$/', (string)$data[0]) || !preg_match('/^[0-9]+$/', (string)$data[1])) {
continue;
}

Expand Down Expand Up @@ -114,7 +114,7 @@
while (!feof($file)) {
$data = fgetcsv($file);

if (!preg_match('/^[0-9]+$/', $data[0]) || !preg_match('/^[0-9]+$/', $data[1])) {
if (!preg_match('/^[0-9]+$/', (string)$data[0]) || !preg_match('/^[0-9]+$/', (string)$data[1])) {
continue;
}

Expand All @@ -136,7 +136,7 @@
while (!feof($file)) {
$data = fgetcsv($file);

if (!preg_match('/^[0-9]+$/', $data[0]) || !preg_match('/^[0-9]+$/', $data[1])) {
if (!preg_match('/^[0-9]+$/', (string)$data[0]) || !preg_match('/^[0-9]+$/', (string)$data[1])) {
continue;
}

Expand Down

0 comments on commit 1e96621

Please sign in to comment.