Skip to content

Commit 098e665

Browse files
committed
fix: province index error
1 parent f30f683 commit 098e665

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

libs/lpavatar.class.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,11 @@ function getlp() {
6161
$this->onerr();
6262
}
6363

64-
$province = $this->province[$uid[3]%31-1];
64+
$pindex = $uid[3]%31-1;
65+
if ($pindex < 0 ) {
66+
$pindex = 0;
67+
}
68+
$province = $this->province[$pindex];
6569
$city = $this->city[$uid[3]%24];
6670
$lp1 = $this->num[$uid[1]%34];
6771
$lp2 = $this->num[$uid[2]/10];

0 commit comments

Comments
 (0)