E2PDF sanitize shortcode ruins Greek names

1 December, 2020 18:25:25
chsfletch
Topics: 2
Messages: 7
Hello,

I am using E2PDF to create a directory upon submit using WP and formidable forms this shortcode is in the email notification

[e2pdf-save id="3" flatten="1" name="[5217 sanitize=1]_[5216 sanitize=1]" create_dir="true" dir="/forms-gr/chsGR/forms/CHS_AUTH_[5341]_[5217 sanitize=1]_[5216 sanitize=1]" create_htaccess="false" overwrite="true" download="true"]

The goal is to take the hidden field 5341 which is the form ID and the first and last name of the person to create distinct directories for each form submission. Before I used sanitize, this worked great until I was told that Greeks have two first names and possible two surnames. They are always written with a space. US names with US KB work great, even with a space, I get the dash as expected with lower case letters. This breaks down when a Greek polytonic KB is used. I am unable to locate the sanitize programming hook to examine the function which cleans up the data.

Greek characters are displayed as &^$%$@#$#!@%Y^%*&. I am sure it has something to do with the function, if I could just read it through.I need to find out what I am missing. Plus, our US users want to have capitol letters, so I want to remove the "tolower()" function. I have the feeling it would solve the greek characters problem as well,l but I need to keep spaces replaced with dashes
1 December, 2020 19:22:07
E2Pdf
Support
Topics: 7
Messages: 3331
Hi,

It seems "sanitize" shortcode attribute under Formidable Forms using standard wordpress function "sanitize_title_with_dashes" which encodes the characters. We are now checking for possible solutions to fix current issue and hope will update with some solution soon.

We remain at your service.


We would really appreciate your feedback at WordPress.org!
1 December, 2020 20:30:01
chsfletch
Topics: 2
Messages: 7
Thanks for the quick reply. Just to make sure I understand. Even though I used sanitize=1 in the e2pdf save, it still came through formidable since sanitize=1 was used in the form field number. And that you believe that passes back through to a standard WP function.

I now have a path to look as well.
2 December, 2020 12:36:54
E2Pdf
Support
Topics: 7
Messages: 3331
Hi,

We just released an RC build (1.13.16) with additional filters which will allow to hook shortcode attributes values with "filter" and must allow you format "dir" and "name" as you need.

You can apply update now by turning on updates from "e2pdf.com". Option can be enabled at "E2Pdf" -> "Settings" -> "Release Candidate Builds" (screenshot). After enabling this option you must be able check for updates at "Dashboard" -> "Updates" and update plugin as usual to version 1.13.16.

It's recommended to turn off this option after update

After update you can add to your child theme functions.php or as PHP Snippet this function:

https://codeshare.io/aJE8AZ

It will replace multiple spaces with dashes without encoding the names, however you can update it to needed format with some additional PHP code or wordpress functions for example undecode already coded value, make it lowercase however some PHP knowledge will be required.

After adding function you must also remove "sanitize=1" attribute from the values, as exactly this attribute converts the "names" to "&^$%$@#$#!@%Y^%*&":

[e2pdf-save id="3" flatten="1" name="[5217]_[5216]" create_dir="true" dir="/forms-gr/chsGR/forms/CHS_AUTH_[5341]_[5217]_[5216]" create_htaccess="false" overwrite="true" download="true"]

Can you try please current solution and let us know if this will work for you.

P.S. function added to functions.php or "PHP Snippet" will work for each "e2pdf-save" shortcode with "name"/"dir" attributes, so if you have multiple shortcode, you can add some other attribute to shortcode and detect via PHP if it exists and only in this case apply the function instead of comparing Template ID.

We remain at your service.

We would really appreciate your feedback at WordPress.org!
4 December, 2020 18:14:02
chsfletch
Topics: 2
Messages: 7
Thanks, but this message was not visible to me until you gave me a link. I would not have made the other post.
5 December, 2020 03:03:48
chsfletch
Topics: 2
Messages: 7
Hi Oleksandr,
Everything worked well. Thanks for your support. Just now the only way I can see this thread is to go to the other thread and click the link there. I hope you keep the filter hook in the plugin. WP is considering the one I made for the core files by adding a new context in sanitize_titles_with_dashes(), a core file. Formidable forms liked the idea, but said WP devs will probably reject the filter hook.

Again, Thanks for solving my problem.
5 December, 2020 15:01:20
E2Pdf
Support
Topics: 7
Messages: 3331
Hi,

Glad to hear that issue resolved. We are now rebuilding our "Help Desk" and hope it will be more comfortable to use and watch threads updates.

We remain at your service.
We would really appreciate your feedback at WordPress.org!