MechWarriorOnline / issue-tracker

MWO Issue Tracker
18 stars 1 forks source link

mwomercs.com Leaderboard pilot name ignores extra spaces in output #283

Closed SCUR0 closed 6 years ago

SCUR0 commented 6 years ago

I parse PGI's leaderboard for The Jarl's List.

Pilot names that have multiple spaces are printed the same as pilots with single space.

e.g.

Select season 4 after clicking links

https://mwomercs.com/profile/leaderboards?type=0&user=Kai+Allard-Liao

https://mwomercs.com/profile/leaderboards?type=0&user=Kai++Allard-Liao

Pilot name "Kai Allard-Liao" and "Kai  Allard-Liao" are printed as "Kai Allard-Liao"

This causes issues with identifying pilot data in my database.

Tarogato-MWO commented 6 years ago

For the record, this is as simple as modifying the CSS for this table's class,

Example,

.table-striped { white-space: pre; }

Although this could influence the many tables elsewhere on the site that use this class. It shouldn't be a problem as long as there is no incidental line breaks or extraneous spaces where they shouldn't be.

SCUR0 commented 6 years ago

@Tarogato-MWO An easier way to fix this that shouldn't risk any issues in CSS would be to use REPLACE() in SQL or str_replace() in PHP to replace spaces with   in player name output.

SCUR0 commented 6 years ago

This can be closed as fixed. Turns out it was a html render that was showing it as not having extra spaces. Once I changed my parse script to use raw html, I am able to parse extra spaces properly.