GetSimple Support Forum

Full Version: Slugs in servers with no mb_* functions
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
It seems GS has trouble creating slugs if your server does not have the multibyte extension (mb_* functions) and you use non US-ASCII latin characters (á, è, ...) in your page titles.

Suggested patch:

Edit /admin/inc/basic.php, find this (around line 62):
PHP Code:
function to7bit($text,$from_enc="UTF-8") {
        if (
function_exists('mb_convert_encoding')) {
           
$text mb_convert_encoding($text,'HTML-ENTITIES',$from_enc);
       } 

Just after that, in line 66, insert this:

PHP Code:
    else 
        
$text htmlspecialchars_decode(utf8_decode(htmlentities($textENT_COMPAT'utf-8'false))); 

...just before this:

PHP Code:
$text preg_replace

Now you should be able to use a title like Déjà vu, and the page slug will be deja-vu (and saved as deja-vu.xml, not as d%C3%A9j%C3%A0-vu.xml).

(Ref: http://stackoverflow.com/questions/11974...es-charset )

Thoughts?
nice fallback
Why would someone not have multibyte at this point though ?
No idea why, maybe for (excessive) security reasons?
GitHub issue #464
I can tell it works great!
Already done in svn, so it will be fixed for next GS 3.2.0 release.
great!


(2012-12-25, 22:03:25)Carlos Wrote: [ -> ]Already done in svn, so it will be fixed for next GS 3.2.0 release.
3.3.0
3.2 is already in beta testing, only hotfixes at this point.
Oops!