DMPRoadmap / roadmap

DCC/UC3 collaboration for a data management planning tool
MIT License
106 stars 109 forks source link

Address/Prevent DB Strings With Leading, Trailing, or Multiple Consecutive Spaces #3432

Open aaronskiba opened 4 months ago

aaronskiba commented 4 months ago

Please complete the following fields as applicable:

What version of the DMPRoadmap code are you running? (e.g. v2.2.0)

Description

SELECT COUNT(*)
FROM users
WHERE firstname LIKE ' %'
OR firstname LIKE '% '
OR surname LIKE ' %'
OR surname LIKE '% ';
-------------------------
count: 336
SELECT COUNT(*)
FROM orgs
WHERE name LIKE ' %'
OR name LIKE '% '
OR name LIKE '%  %'; -- more than one space
-------------------------
count: 12
SELECT COUNT(*)
FROM plans
WHERE title LIKE ' %'
OR title LIKE '% '
OR title LIKE '%  %'; -- more than one space 
-------------------------
count: 481

These extra spaces can lead to unwanted outcomes when executing search. The following is one example: