Webrocker Posted November 19, 2015 Posted November 19, 2015 Hi, I just stumbled across this: We have a title of an Event "»The Good Ones« – The Last show" (excluding the double quotes). From this a PW page is created via the API and the title is used for the page name, but is sanitized with "$Sanitizer->pageName(title,Sanitizer::translate);" This results in "the-good-ones" -- everything following the "«" is stripped. If the "«" is the first char in the title -- "«The good ones» – The Last Show" -- the the page name is empty. I traced the pageName -> name -> nameFilter chain in wire/core/Sanitizer.php, but I don't see an obvious point where this could be caused, only that this must be inside the "if $beautify...." clauses. My guess is, it is in the nameFilter function, but there's a lot going on with multibite and ASCII stuff, which is quite over my head. Can somebody else confirm this? (PW 2.6.21 / with Multilanguage activated) thxTom
Webrocker Posted November 19, 2015 Author Posted November 19, 2015 hi tpr, thank you, but it seems like pageNameTranslate($val) is the same as pageName($val,Sanitizer::translate) ? public function pageName($value, $beautify = false, $maxLength = 128) { return strtolower($this->name($value, $beautify, $maxLength, '-')); } public function pageNameTranslate($value, $maxLength = 128) { return $this->pageName($value, self::translate, $maxLength); } What helps in my case is to add "« -" in the InputfieldPagename translation settings. cheers, Tom 1
tpr Posted November 19, 2015 Posted November 19, 2015 Looks so. I haven't looked into the code but yesterday I had a same situation where it helped. So as it turns out the character that was missing for me was in the InputfieldPagename translation settings.
Webrocker Posted November 19, 2015 Author Posted November 19, 2015 I'm puzzled why the "«" seems to cut off the string, but "»" doesn't: "»blahbleh«bloh" will return "blahbleh", "«Blahbleh»bloh" will return "". Strange.
Soma Posted November 19, 2015 Posted November 19, 2015 https://github.com/ryancramerdesign/ProcessWire/issues/779
Christophe Posted November 19, 2015 Posted November 19, 2015 And what about « Blahbleh »bloh or « Blahbleh » bloh? Does it change something? With French quotes you normally have spaces.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now