Jump to content

Recommended Posts

Posted

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)

thx
Tom

Posted

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

  • Like 1
Posted

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.

Posted

I'm puzzled why the "«" seems to cut off the string, but "»" doesn't: "»blahbleh«bloh" will return "blahbleh", "«Blahbleh»bloh" will return "".

Strange. :-)

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...