Jump to content

HTML entity on Prestashop 1.4.10.0


Recommended Posts

I installed the latest version Prestashop 1.4.10.0.

I gave Store name Testíček.

In the source code I get the <title>Testíček</title>.

Entities appear in the title of products and categories.

I need to display Czech characters in the source code without entities.

Can you help me please to remove entities?

post-273743-0-61624000-1362915688_thumb.png

Share this post


Link to post
Share on other sites

Charset on my page is (source code):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="cs">
<head>
	<title>Testíček</title>
	<meta name="Shop powered by PrestaShop" />
	<meta name="shop, prestashop" />
	<meta http-equiv="application/xhtml+xml; charset=utf-8" />
	<meta name="PrestaShop" />
	<meta name="index,follow" />

Edited by sparhawk (see edit history)

Share this post


Link to post
Share on other sites

Charset on my page is (source code):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="cs">
<head>
	<title>Testíček</title>
	<meta name="Shop powered by PrestaShop" />
	<meta name="shop, prestashop" />
	<meta http-equiv="application/xhtml+xml; charset=utf-8" />
	<meta name="PrestaShop" />
	<meta name="index,follow" />

 

it doesnt look well,

 

 

from w3c standards:

 

A.9. Character Encoding

Encode your document in UTF-8 or UTF-16. When delivering the document from a server, DO set the character encoding for a document via the charset parameter of the HTTP Content-Type header. When not delivering the document from a server, DO set the encoding via a "meta http-equiv" statement in the document (e.g., <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />). However, note that doing so will explicitly bind the document to an a single content type.

 

Change your meta tag with charset, and try again

 

im not sure that this will solve your problem, but you can try :)

Share this post


Link to post
Share on other sites

vekia thank you very much for your answer.

 

In version Prestashop 1.4.7.3 i have made ​​these adjustments:

/tools/smarty/plugins/modifier.escape.php

/tools/smarty_v2/plugins/modifier.escape.php

 

case 'htmlall':
		return htmlentities($string, ENT_QUOTES, $char_set);
Replace to:
case 'htmlall':
		return htmlspecialchars($string, ENT_QUOTES, $char_set);

 

/classes/Tools.php

 

return htmlentities($string, $type, ‘utf-8’);

Replace to:
return htmlspecialchars($string, $type, ‘utf-8’);

after these modifications in the source code was no entity - Prestashop 1.4.7.3.

 

I rewrite the modified file /tools/smarty/plugins/modifier.escape.php

from version 1.4.7.3 to version Prestashop 1.4.10.0 and entities in the head with repairs.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="[url=""]http://www.w3.org/1999/xhtml[/url]" xml:lang="[url=""]cs[/url]">
<head>
	<title>Testíček</title>
	<meta name="[url=""]description[/url]" content="[url=""]Shop powered by PrestaShop[/url]" />
	<meta name="[url=""]keywords[/url]" content="[url=""]shop, prestashop[/url]" />
	<meta http-equiv="[url=""]Content-Type[/url]" content="[url=""]application/xhtml+xml; charset=utf-8[/url]" />
	<meta name="[url=""]generator[/url]" content="[url=""]PrestaShop[/url]" />
	<meta name="[url=""]robots[/url]" content="[url=""]index,follow[/url]" />

I think that they have to somehow modify this file because it has a different structure compared to version 1.4.7.3.

 

Entities remain in modules :( for example:

<!-- Block user information module HEADER -->
<div id="header_user">
			<p id="header_user_info">
						   Vítejte,
																		  <a href="http://kove/my-account.php">přihlášení</a>
										   </p>
			<ul id="header_nav">
														   <li id="shopping_cart">
										   <a href="http://kove/order.php" title="Váš nákupní košík">Košík:</a>
										   <span class="ajax_cart_quantity hidden">0</span>
										   <span class="ajax_cart_product_txt hidden">kus zboží za</span>
										   <span class="ajax_cart_product_txt_s hidden">ks zboží za</span>
										   <span class="ajax_cart_total hidden">
																										  0,00 €
																						  </span>
										   <span class="ajax_cart_no_product">(prázdný)</span>
						   </li>
														   <li id="your_account"><a href="http://kove/my-account.php" title="Váš účet">Váš účet</a></li>
			</ul>
</div>
<!-- /Block user information module HEADER -->

 

Somewhere something should be adjusted just do not know what <_<

Edited by sparhawk (see edit history)

Share this post


Link to post
Share on other sites

  • 2 months later...

Hi sparhawk, I´m not sure, but as I´m just now checking the same thing, it looks like the problem is whole Czech Locale, it seems the files are saved with entities, because now when I´m checking it, entities are only withing general texts downloaded with czech locale(like in your example, přihlášení, košík, etc...) , anything I write on my own for example product titles, or editorial text, there are no entities.

Share this post


Link to post
Share on other sites

  • 3 months later...

Hello,

 

I have same problem in 1.4.11.

I have made changes in:
/tools/smarty/plugins/modifier.escape.php
/tools/smarty_v2/plugins/modifier.escape.php

/classes/Tools.php

 

In DB seems Czech is ok, in Translations too..(compile and cache is cleen)...

 

Please, do you have any idea, where can be problem??

 

Thank you, Assramm

Share this post


Link to post
Share on other sites

what database encoding you use?

 

Hello,

 

utf8_general_ci   ..is it wrong?

 

I think, that I have still problem in "tools.php"

{
	 	if (!$html)
			$string = strip_tags($string);
		return @Tools::htmlentitiesUTF8($string, ENT_QUOTES);
	}

	public static function htmlentitiesUTF8($string, $type = ENT_QUOTES)
	{
		if (is_array($string))
			return array_map(array('Tools', 'htmlentitiesUTF8'), $string);
		return htmlspecialchars((string)$string, $type, 'utf-8');
	}

	public static function htmlentitiesDecodeUTF8($string)
	{
		if (is_array($string))
			return array_map(array('Tools', 'htmlentitiesDecodeUTF8'), $string);
		return html_entity_decode((string)$string, ENT_QUOTES, 'utf-8');
	}

..I hope that this is correct..

 

Thank you, best reggards, J.D.

Edited by Assramm (cz) (see edit history)

Share this post


Link to post
Share on other sites

So, I have something new.

 

I have title correct, name of products are correct but..

 

Still I heve problem with czech entites in translations:

modules - (cart block, opc, and else).

For example:

 

Translations of block cart:

<?php

global $_MODULE;
$_MODULE = array();
$_MODULE['<{blockcart2}prestashop>blockcart_20351b3328c35ab617549920f5cb4939'] = 'Přizpůsobení #';
$_MODULE['<{blockcart2}prestashop>blockcart_ed6e9a09a111035684bb23682561e12d'] = 'odstranit tento produkt z košíku';
$_MODULE['<{blockcart2}prestashop>blockcart_a85eba4c6c699122b2bb1387ea4813ad'] = 'Košík';
$_MODULE['<{blockcart2}prestashop>blockcart_86024cad1e83101d97359d7351051156'] = 'produkty';
$_MODULE['<{blockcart2}prestashop>blockcart_f5bf48aa40cad7891eb709fcf1fde128'] = 'produkt';
$_MODULE['<{blockcart2}prestashop>blockcart_9e65b51e82f2a9b9f72ebe3e083582bb'] = '(prázdný)';
$_MODULE['<{blockcart2}prestashop>blockcart_4b7d496eedb665d0b5f589f2f874e7cb'] = 'Detail produktu';
$_MODULE['<{blockcart2}prestashop>blockcart_853ae90f0351324bd73ea615e6487517'] = ':';
$_MODULE['<{blockcart2}prestashop>blockcart_09dc02ecbb078868a3a86dded030076d'] = 'V košíku nemáte žádné zboží';

Here are wrong entites in page of this cart:

<!-- MODULE Block cart -->
<div id="cart_block" class="block exclusive">
	<h4>
		<a href="http://example.com/order-opc.php">Košík</a>
				<span id="block_cart_expand" class="hidden"> </span>
		<span id="block_cart_collapse" > </span>
			</h4>
	<div class="block_content">
	<!-- block summary -->
	<div id="cart_block_summary" class="collapsed">
		<span class="ajax_cart_quantity" >1</span>
		<span class="ajax_cart_product_txt_s" style="display:none">produkty</span>
		<span class="ajax_cart_product_txt" >produkt</span>
		<span class="ajax_cart_total" >230 Kč</span>
		<span class="ajax_cart_no_product" style="display:none">(prázdný)</span>
	</div>

..

 

Can you help me please to remove entities?

Share this post


Link to post
Share on other sites

  • 2 years later...

Hello all,

 

I have used this solution that worked in PS earlier version. What about version 1.6?

I have characters like αντικ apppearing in SMC Source code instad of my Greek text.

My database is set on 'utf8_general_ci'

Does anybody know how to find a solution so that CMS sourse is always stored in original text format?

I cannot apply above solutions to PS1.6 since there are big differences.

 

Thanks for any kind of reply.

Share this post


Link to post
Share on other sites

 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More