aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-07-19 07:45:13 -0700
committerAnton Tananaev <anton@traccar.org>2023-07-19 07:45:13 -0700
commitdcef13b1fc7cf052463e11532365b3ad1f948b99 (patch)
treeebf6a3b5d0a84555f4a3b0a55739b0aa2f5b7382 /src/main/java/org/traccar
parent5a1a8d9192ee44b116f10e5ce3551a4e4bc70deb (diff)
downloadtrackermap-server-dcef13b1fc7cf052463e11532365b3ad1f948b99.tar.gz
trackermap-server-dcef13b1fc7cf052463e11532365b3ad1f948b99.tar.bz2
trackermap-server-dcef13b1fc7cf052463e11532365b3ad1f948b99.zip
Trim important fields
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r--src/main/java/org/traccar/model/Device.java4
-rw-r--r--src/main/java/org/traccar/model/Driver.java2
-rw-r--r--src/main/java/org/traccar/model/User.java2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/model/Device.java b/src/main/java/org/traccar/model/Device.java
index 2c582328e..c259e1413 100644
--- a/src/main/java/org/traccar/model/Device.java
+++ b/src/main/java/org/traccar/model/Device.java
@@ -53,7 +53,7 @@ public class Device extends GroupedModel implements Disableable, Schedulable {
}
public void setUniqueId(String uniqueId) {
- this.uniqueId = uniqueId;
+ this.uniqueId = uniqueId != null ? uniqueId.trim() : null;
}
public static final String STATUS_UNKNOWN = "unknown";
@@ -100,7 +100,7 @@ public class Device extends GroupedModel implements Disableable, Schedulable {
}
public void setPhone(String phone) {
- this.phone = phone;
+ this.phone = phone != null ? phone.trim() : null;
}
private String model;
diff --git a/src/main/java/org/traccar/model/Driver.java b/src/main/java/org/traccar/model/Driver.java
index b9e023088..2689c67f2 100644
--- a/src/main/java/org/traccar/model/Driver.java
+++ b/src/main/java/org/traccar/model/Driver.java
@@ -38,7 +38,7 @@ public class Driver extends ExtendedModel {
}
public void setUniqueId(String uniqueId) {
- this.uniqueId = uniqueId;
+ this.uniqueId = uniqueId != null ? uniqueId.trim() : null;
}
}
diff --git a/src/main/java/org/traccar/model/User.java b/src/main/java/org/traccar/model/User.java
index 53594fe07..0540f16d7 100644
--- a/src/main/java/org/traccar/model/User.java
+++ b/src/main/java/org/traccar/model/User.java
@@ -63,7 +63,7 @@ public class User extends ExtendedModel implements UserRestrictions, Disableable
}
public void setPhone(String phone) {
- this.phone = phone;
+ this.phone = phone != null ? phone.trim() : null;
}
private boolean readonly;