phplist3
phplist3 copied to clipboard
Better support for non-latin strings in select dropdown of search subcribers page
I am using phpList along with attributes in the Greek language and in the search subscribers section the filtering dropdown which shows the available attributes doesn't correctly truncate Greek strings due to the substr command.
I propose to change it with the function shortenTextDisplay (defined in lib.php) which uses the corresponding mb_ versions for substr etc. if available.
Before:
After:
Hey @michield,
I agree. Per @bramley 's observation my pull request should then be amended and make use of shortenText as implemented in his pull request to avoid adding the span element. Should i push a new commit?
Well, having a span inside an LI is perfectly valid, so I think it' s fine as it is. Looking at it more closely, the substr returns the first X characters, where shortentextdisplay returns the first X number of characters followed by ... followed by the last number of Y characters, so the effect is different.
The result is acceptable though. The main aim is to avoid creating a very wide dropdown, which would render badly particularly on mobile.
From what I see though, the dropdown in question is a simple SELECT tag with OPTIONS so isn't adding a span there invalid? Chrome/firefox browsers seem to work OK with it since it looks like they tidy up, keeping the text and getting rid of the span tag but is it a sure thing?
This pull request has been mentioned on phpList Discuss. There might be relevant details there:
https://discuss.phplist.org/t/3-6-9-release-candidate-ready-for-testing/8445/1
This pull request has been mentioned on phpList Discuss. There might be relevant details there:
https://discuss.phplist.org/t/phplist-3-6-9-is-available-for-download/8474/1