Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better way to whitelist non-ascii characters (Asian characters) in config.php #393

Closed
gideonso opened this issue Mar 6, 2021 · 5 comments

Comments

@gideonso
Copy link

gideonso commented Mar 6, 2021

For now, if a site needs non ascii page name, there are two setting needed to be set:

  1. $config->pageNameCharset = "UTF8"

This is OK.

  1. $config->pageNameWhitelist = "A very long Chinese Character List"

It is very hard to put all the Chinese character there.

If there is another way to whitelist all the non-ascii character would be a big plus to ProcessWire multi-language support.

Related forum thread: https://processwire.com/talk/topic/12776-pw-3012-support-for-extended-utf8-page-namesurls/?page=2&tab=comments#comment-146652

@gideonso gideonso changed the title Betyter way to whitelist non-ascii characters (Asian characters) in config.php Better way to whitelist non-ascii characters (Asian characters) in config.php Mar 6, 2021
@gideonso
Copy link
Author

gideonso commented Mar 7, 2021

This can be done by leave $config->pageNameWhitelist = "". I close this request.

@openidauthority
Copy link

I propose that $config->pageNameWhitelist = "" should disable the whitelist, and use only the internal blacklist.

To make this happen, another condition would need to be added to the sanitizer, right after checking the blacklist:

} else if($whitelist === false) {
  // whitelist is disable, allow everything that is not blacklisted

https://github.com/processwire/processwire/blob/master/wire/core/Sanitizer.php#L843

@ryancramerdesign
Copy link
Member

@openidauthority Thanks, that makes sense to me, I have added it.

@matjazpotocnik
Copy link
Collaborator

@gideonso, can you close this issue if you are happy with Ryan's fix?

@gideonso
Copy link
Author

It is good to me. Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants