From 24d385cd642f57ac2e137999db035763bf42ae09 Mon Sep 17 00:00:00 2001 From: Ghost_chu Date: Thu, 7 Nov 2024 17:05:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20IP=20=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=9B=BE=E8=A1=A8=E6=B5=81=E9=87=8F=E7=BB=9F=E8=AE=A1=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../peerbanhelper/module/impl/webapi/PBHPeerController.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/ghostchu/peerbanhelper/module/impl/webapi/PBHPeerController.java b/src/main/java/com/ghostchu/peerbanhelper/module/impl/webapi/PBHPeerController.java index 0f455728e2..df39530d1e 100644 --- a/src/main/java/com/ghostchu/peerbanhelper/module/impl/webapi/PBHPeerController.java +++ b/src/main/java/com/ghostchu/peerbanhelper/module/impl/webapi/PBHPeerController.java @@ -7,6 +7,7 @@ import com.ghostchu.peerbanhelper.module.AbstractFeatureModule; import com.ghostchu.peerbanhelper.module.impl.rule.ActiveMonitoringModule; import com.ghostchu.peerbanhelper.util.IPAddressUtil; +import com.ghostchu.peerbanhelper.util.MsgUtil; import com.ghostchu.peerbanhelper.util.context.IgnoreScan; import com.ghostchu.peerbanhelper.util.paging.Page; import com.ghostchu.peerbanhelper.util.paging.Pageable; @@ -85,7 +86,7 @@ private void handleInfo(Context ctx) throws SQLException { .selectRaw("SUM(uploaded) as uploaded_total, SUM(downloaded) as downloaded_total") .groupBy("address") .where() - .eq("address", new SelectArg(ip)) + .eq("address", MsgUtil.escapeSql(ip)) .queryRawFirst(); if (upDownResult != null) { if (upDownResult.length == 2) {