diff --git a/webroot/index.php b/webroot/index.php index f134a05..2b28de2 100644 --- a/webroot/index.php +++ b/webroot/index.php @@ -225,7 +225,8 @@ function do_paste() // it's OK now, let's post it $ident = generate_ident(); $stmt = $dbh->prepare("INSERT INTO `pastes` SET `ident`= ?, `ip`=?, `date`=NOW(), `text`=?, `mimetype`=?, `expires` = TIMESTAMPADD( SECOND, ?, NOW())"); - $stmt->bind_param('ssssi', $ident, $_SERVER['REMOTE_ADDR'], $_POST['content'], $mime_type, $ttl ); + $ip = hash('sha256',$_SERVER['REMOTE_ADDR']); + $stmt->bind_param('ssssi', $ident, $ip, $_POST['content'], $mime_type, $ttl ); $stmt->execute(); header("Location: ".BASEURL."p/".$ident); @@ -280,7 +281,8 @@ function _limit_exceeded( $type, $limit ) { die("Couldn't perform throttle check"); } - $stmt->bind_param("s", $_SERVER['REMOTE_ADDR'] ); + $ip = hash('sha256',$_SERVER['REMOTE_ADDR']); + $stmt->bind_param("s", $ip); $stmt->execute(); $stmt->bind_result( $count ); $stmt->fetch();