Skip to content

Commit ffd2b58

Browse files
committed
Fix #6 - compatibility issues
1 parent 195d91c commit ffd2b58

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

classes/token.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Token
1111
* @param timestamp $expire expiration time
1212
* @return String token
1313
*/
14-
public static function new($id, $data, $expire)
14+
public static function add($id, $data, $expire)
1515
{
1616
global $mysqli;
1717
$salt = uniqid(mt_rand(), true);

classes/user.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ public static function login()
251251
if (isset($_POST['remember'])&&$_POST['remember'])
252252
{
253253
$year = strtotime('+356 days', time());
254-
$token = Token::new($id, 'remember', $year);
254+
$token = Token::add($id, 'remember', $year);
255255
setcookie('token', $token, $year, "/");
256256
setcookie('user', $id, $year, "/");
257257
}
@@ -283,7 +283,7 @@ public static function restore_session()
283283
$year = strtotime('+356 days', time());
284284
unset($_COOKIE['token']);
285285
$_SESSION['user'] = $id;
286-
$token = Token::new($id, 'remember', $year);
286+
$token = Token::add($id, 'remember', $year);
287287
setcookie('token', $token, $year);
288288
}
289289
else
@@ -482,7 +482,7 @@ public static function password_link()
482482
$id = $query->fetch_assoc()['id'];
483483
$time = strtotime('+1 day', time());
484484

485-
$token = Token::new($id, 'passwd', $time);
485+
$token = Token::add($id, 'passwd', $time);
486486

487487
$link = WEB_URL."/admin/?do=lost-password&id=$id&token=$token";
488488
$to = $email;
@@ -507,7 +507,7 @@ public function email_link(){
507507
$time = strtotime('+1 day', time());
508508
$id = $this->id;
509509

510-
$token = Token::new($id, 'email;$email', $time);
510+
$token = Token::add($id, 'email;$email', $time);
511511

512512

513513
$link = WEB_URL."/admin/?do=change-email&id=$id&token=$token";

install.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@
8383
$array = explode(";", $sql);
8484

8585
foreach ($array as $value) {
86-
if (empty(trim($value)))
86+
$val = trim($value);
87+
if (empty($val))
8788
{
8889
continue;
8990
}

0 commit comments

Comments
 (0)