Incorrect display Unicode in SEF url

  • Posts: 1
  • Thank you received: 1
9 years 9 months ago #222899

-- HikaShop version -- : 2.6.0
-- Joomla version -- : 3.4.5
-- PHP version -- : 5.5
-- Browser(s) name and version -- : chrome
-- Error-message(debug-mod must be tuned on) -- : Incorrect display Unicode in SEF url

I've found 3 errors for Unicode languages.

in :
Create Metakeyword unicode :
file : back\helpers\seo.php
line 44
old :

if(strlen($word)<3){
best :
if(mb_strlen($word)<3){

=====================================
Create MetaDescription:
file : back\helpers\seo.php
line26

old :
$meta = substr($this->clean($element->$description),0,$max);
best :
$meta = mb_substr($this->clean($element->$description),0,$max);

=====================================
Create UTF8 SEF url:
file : back\classes\product.php
Old :
		if(method_exists($app,'stringURLSafe')){
			$element->alias = $app->stringURLSafe($element->alias);
		}else{
			$element->alias = JFilterOutput::stringURLSafe($element->alias);
		}
Best :
		if(method_exists($app,'stringURLSafe')){
			$element->alias = $app->stringURLSafe($element->alias);
		}else{
			$element->alias = JFilterOutput::stringURLUnicodeSlug($element->alias);
		}

=====================================
Create UTF8 SEF url:
file : back\classes\category.php
old :
		$app = JFactory::getApplication();
		if(method_exists($app,'stringURLSafe'))
			$element->alias = $app->stringURLSafe(strip_tags($element->alias));
		else
			$element->alias = JFilterOutput::stringURLSafe(strip_tags($element->alias));
best:
		$app = JFactory::getApplication();
		if(method_exists($app,'stringURLSafe'))
			$element->alias = $app->stringURLSafe(strip_tags($element->alias));
		else
			$element->alias = JFilterOutput::stringURLUnicodeSlug(strip_tags($element->alias));

=====================================
Create UTF8 SEF url:
file : back\classes\cart.php
old :
		if(method_exists($app,'stringURLSafe')){
			$alias = $app->stringURLSafe($alias);
		}else{
			$alias = JFilterOutput::stringURLSafe($alias);
		}
best:
		if(method_exists($app,'stringURLSafe')){
			$alias = $app->stringURLSafe($alias);
		}else{
			$alias = JFilterOutput::stringURLUnicodeSlug($alias);
		}

Last edit: 9 years 9 months ago by Jerome. Reason: [code] is nice
The following user(s) said Thank You: Jerome

Please Log in or Create an account to join the conversation.

  • Posts: 84306
  • Thank you received: 13701
  • MODERATOR
9 years 9 months ago #222986

Hi,

Thank you for sharing your modifications. We'll include them on our end for better UTF8 support in the URLs with the next version.

Please Log in or Create an account to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum