Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Slugs in servers with no mb_* functions
#1
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?
Reply
#2
nice fallback
Why would someone not have multibyte at this point though ?
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#3
No idea why, maybe for (excessive) security reasons?
Reply
#4
GitHub issue #464
Reply
#5
I can tell it works great!
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
#6
Already done in svn, so it will be fixed for next GS 3.2.0 release.
Reply
#7
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.
My website made with GetSimple CMS is

Arte & Società
www.artesocieta.eu

An indipendent website about Italian Contemporary Visual Arts
Reply
#8
3.3.0
3.2 is already in beta testing, only hotfixes at this point.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#9
Oops!
Reply




Users browsing this thread: 1 Guest(s)