Error with @@@SMARTY:TRIM:SCRIPT@@@


(Evandar) #1

Hello, I have this error at every Piwik page, this is first page - instalation. I had this same error with PHPMV, but i set SMARTY DEBUG = true in config.inc.php in PHPMV root and it was ok. But this ins’t working on Piwik.

I think that reason of this error is php setting which set encoding to utf-8 for mbstring functions, and it rewrites basic functions like strlen to mb_strlen, so strlen is in fact mb_strlen.

php_value mbstring.internal_encoding "utf-8"
php_value mbstring.func_overload 7

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="www.w3.org/1999/xhtml">
<head>
<title>Piwik &rsaquo; Instalace</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<link rel="stylesheet" type="text/css" href="themes/default/common.css?piwik=0.5.4" />
<link rel="stylesheet" type="text/css" href="libs/jquery/themes/base/jquery-ui.css?piwik=0.5.4" />
<link rel="stylesheet" type="text/css" href="themes/default/styles.css?piwik=0.5.4" />
<script type="text/javascript" src="libs/jquery/jquery.js?piwik=0.5.4"></script>
<script type="text/javascript" src="libs/jquery/jquery-ui.js?piwik=0.5.4"></script>
<script type="text/javascript" src="libs/jquery/fdd2div-modified.js?piwik=0.5.4"></script>
<script type="text/javascript">
$(document).ready( function(){
	$('#toFade').fadeOut(4000, function(){ $(this).css('display', 'hidden'); } );
	$('input:first').focus();
	$('#progressbar').progressbar({

		value: 0

	});
});

</script>
<style>
...
</style>
</head>
<body>
<div id="main">
<div id="content">
<div id="logo">
<span id="title">Piwik</span> &nbsp;&nbsp;&nbsp;<span id="subtitle"># Open Source Web Analytics</span>
</div>
<div style="float:right" id="topRightBar">
<span class="topBarElem" style="padding-right:70px">
<span id="languageSelection" style="display:none;position:absolute">
<form action="index.php?action=saveLanguage" method="get">

<select name="language">
<option value="cs">Česky</option>
<option value="be">Беларуская</option>
<option value="bg">Български</option>
<option value="ca">Català</option>
<option value="cs">Česky</option>
<option value="da">Dansk</option>
<option value="de">Deutsch</option>
<option value="el">Ελληνικά</option>

<option value="en">English</option>
<option value="es">Español</option>
<option value="et">Eesti keel</option>
<option value="fi">Suomi</option>
<option value="fr">Français</option>
<option value="gl">Galego</option>
<option value="hu">Magyar</option>
<option value="it">Italiano</option>
<option value="ja">日本語</option>

<option value="ko">한국어</option>
<option value="lt">Lietuvių</option>
<option value="nb">Norsk (bokmål)</option>
<option value="nl">Nederlands</option>
<option value="pl">Polski</option>
<option value="pt">Portugu&ecirc;s</option>
<option value="ro">Română</option>
<option value="ru">Русский</option>

<option value="sk">Slovensky</option>
<option value="sq">Shqip</option>
<option value="sr">Srpski</option>
<option value="sv">Svenska</option>
<option value="th">ไทย</option>
<option value="uk">Украї�<script language="javascript">
	$(document).ready(function() {
		$("#languageSelection").fdd2div({CssClassName:"formDiv"});
		$("#languageSelection").show();
		$("#languageSelection ul").hi<script type="text/javascript">
<!--
$(function() {
if (document.location.protocol === 'https:') {
	$('p.nextStep a').attr('href', $('p.nextStep a').attr('href') + '&clientProtocol=https');
}
});
//-->
</script>lue="zh-cn">简体中文</option>
<option value="z@@@SMARTY:TRIM:SCRIPT@@@
</select>
<input type="submit" value="go"/>
</form>
</span>

@@@SMARTY:TRIM:SCRIPT@@@
</span>
</div>
<div class="both"></div>
<div id="generalInstall">
<ul>
<li class="actualStep">Vítejte!</li>
<li class="futureStep">Kontrola systému</li>
<li class="futureStep">Database setup</li>
<li class="futureStep">Database check</li>
<li class="futureStep">Vytváření tabulek</li>
<li class="futureStep">Hlavní nastavení</li>

<li class="futureStep">Nastavit WWW sídlo</li>
<li class="futureStep">JavaScript tag</li>
<li class="futureStep">Gratulujeme</li>
</ul>		</div>
<div id="detailInstall">
<h1>Vítejte!</h1>
<p>Piwik je open source program pro analýzu webu, pomocí kterého můžete jednoduše získat informace, které chcete od vaších návštěvníků.</p><p>Tento proces je rozdělen to  9 jednoduchých kroků a zabere přibližne 5 minut.</p>
@@@SMARTY:TRIM:SCRIPT@@@
<p class="nextStep">
<a href="index.php?action=systemCheck">Další &raquo;</a>

</p>
</div>
<div class="both"></div>
<br/>
<br/>
<h3>Stav instalace</h3>
<div id="progressbar"></div>
0 % hotovo 
</div>
</div>
</body>
</html>

(vipsoft) #2

What version of php are you running?

I seem to recall someone else reporting this, but it was later attributed to a bug in the regex library.


(Evandar) #3

version 5.2.11

Link www.parahybana.cz/piwik/


(vipsoft) #4

Can you test the following patch?


(Evandar) #5

It is working! Thank you! style_emoticons/<#EMO_DIR#>/smile.gif


(vipsoft) #6

Unfortunately, we won’t be commiting this patch. Upon further review, there are many other places where we use substr_replace, and mbstring does not have a multibyte version of this function (e.g., mb_substr_replace).

Since this is incompatible with the overloaded strlen and strpos functions, and Piwik already sets everything to UTF-8, you should set “mbstring.func_overload” to 0 in your .htaccess.


(Evandar) #7

ok, it is a shame, but thank you for your help. style_emoticons/<#EMO_DIR#>/wink.gif

I think that it is working, you can try it www.parahybana.cz/piwik/ login: vipsoft - password


(vipsoft) #8

Let me rephrase that.

We committed this patch so that the output doesn’t get scrambled. We also added an Installation warning when mbstring.func_overload is enabled.

The reason mbstring.func_overload is “wrong” is because there may be places where substr() is used on binary data (not UTF-8 text), given that the un-overloaded substr() is binary-safe.


(Evandar) #9

Ok style_emoticons/<#EMO_DIR#>/smile.gif Thank You