@anonymous-piwik-user opened this Issue on March 12th 2013

Hi Leute,
Seit dem Upgrade von Piwik 1.10 auf Piwik 1.11.1 kommt im Browserfenster eine Warning mit folgendem Backtrace (Ausschnitt):

There is an error. Please report the message (Piwik 1.11.1) and full backtrace in the Piwik forums (please do a Search first as it might have been reported already!).

Warning: htmlspecialchars() href='function.htmlspecialchars'>function.htmlspecialchars</a>: Invalid multibyte sequence in argument in /var/www/html/piwik/core/DataTable/Filter/SafeDecodeLabel.php on line 53

Backtrace -->
#0 Piwik_ErrorHandler(...) called at [:]
#1 htmlspecialchars(...) called at [/var/www/html/piwik/core/DataTable/Filter/SafeDecodeLabel.php:53]
#2 Piwik_DataTable_Filter_SafeDecodeLabel::safeDecodeLabel(...) called at [/var/www/html/piwik/core/DataTable/Filter/SafeDecodeLabel.php:73]

...
...

In der betreffenden Zeile (Datei core/DataTable/Filter/SafeDecodeLabel.php) steht:
$value = htmlspecialchars($value, $style, 'UTF-8');

In der betreffenden Website wird aber ISO-8859-15 Kodierung verwendet, deshalb die Warnung
Ich habe folgenden Workaround gemacht:
$value = @htmlspecialchars($value, $style, 'UTF-8');
if (empty($value)) {
$value = htmlspecialchars($value, $style, 'ISO-8859-15');
}

Knnt Ihr das Encoding variabel auslesen?

Viele Gre
Helmut
Keywords: htmlspecialchars

@anonymous-piwik-user commented on March 12th 2013

Sorry for not writing in English...
I have now changed SafeDecodeLabel.php to:

$origValue = $value;
$value = @htmlspecialchars($value, $style, 'UTF-8');
if (empty($value)) {
$value = htmlspecialchars(utf8_encode($origValue), $style, 'UTF-8');
}

@mattab commented on March 13th 2013 Owner

please write in english, but even better: ask in the forums unless you can write a report showing an exact bug and how to reproduce, thanks!

This Issue was closed on March 13th 2013
Powered by GitHub Issue Mirror