Subversion Repositories SvarDOS

Rev

Rev 1702 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1702 Rev 1703
Line 464... Line 464...
464
  if (!empty($EDIT_ALLOWED_MINUTES)) {
464
  if (!empty($EDIT_ALLOWED_MINUTES)) {
465
    if (!empty($_COOKIE['mateuszbbkey'])) {
465
    if (!empty($_COOKIE['mateuszbbkey'])) {
466
      $artkey = $_COOKIE['mateuszbbkey'];
466
      $artkey = $_COOKIE['mateuszbbkey'];
467
    } else {
467
    } else {
468
      $artkey = bin2hex(random_bytes(128));
468
      $artkey = bin2hex(random_bytes(128));
469
      setcookie('mateuszbbkey', $artkey, array('secure' => true, 'httponly' => true, 'samesite' => 'Lax'));
469
      setcookie('mateuszbbkey', $artkey, array('secure' => false, 'httponly' => true, 'samesite' => 'Lax'));
470
    }
470
    }
471
  }
471
  }
472
  // zapisz wiadomość
472
  // zapisz wiadomość
473
  $msg = array('author' => trim($_POST['username']), 'ip' => $_SERVER['REMOTE_ADDR'], 'trip' => $tripsig, 'msg' => trim($_POST['msg']), 'key' => password_hash($artkey, PASSWORD_DEFAULT));
473
  $msg = array('author' => trim($_POST['username']), 'ip' => $_SERVER['REMOTE_ADDR'], 'trip' => $tripsig, 'msg' => trim($_POST['msg']), 'key' => password_hash($artkey, PASSWORD_DEFAULT));
474
  file_put_contents($DATADIR . 'threads/' . $thread . '/' . $postid, serialize($msg));
474
  file_put_contents($DATADIR . 'threads/' . $thread . '/' . $postid, serialize($msg));