Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

htmlspecialchars Warning im Browserfenster #3816

Closed
anonymous-matomo-user opened this issue Mar 12, 2013 · 2 comments
Closed

htmlspecialchars Warning im Browserfenster #3816

anonymous-matomo-user opened this issue Mar 12, 2013 · 2 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.

Comments

@anonymous-matomo-user
Copy link

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-matomo-user
Copy link
Author

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
Copy link
Member

mattab commented Mar 13, 2013

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Major Indicates the severity or impact or benefit of an issue is much higher than normal but not critical. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.
Projects
None yet
Development

No branches or pull requests

2 participants