View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0017210 | phpList 3 application | Interface - Administrator | public | 04-06-14 11:33 | 11-06-14 08:16 |
Reporter | wtps0n | ||||
Priority | normal | Severity | trivial | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.0.6 | ||||
Target Version | 3.0.7 | Fixed in Version | 3.0.7 | ||
Summary | 0017210: There is question marks instead of polish/hungarian special chars | ||||
Description | When working with polish translation, admininstrator interface shows question marks where should polish UTF-8 encoded letters. I've also checked this out and there is similiar problem with hungarian translation. Problem is with using strtolower php function. There should be mb_strtolower used. I've made a three small patches which resolves this issue. | ||||
Steps To Reproduce | Install fresh phplist, use UTF-8 in php.ini or apache configuration (php_value default_charset "utf-8"). After that go to administration panel and change language to polish (polski). You will see :-)) | ||||
Tags | No tags attached. | ||||
|
index.php.patch (627 bytes)
--- index.php 2013-09-20 23:29:45.000000000 +0200 +++ index.php.new 2014-06-03 23:51:15.000000000 +0200 @@ -343,7 +343,7 @@ } if (!$ajax) { - print '<h4 class="pagetitle">'.strtolower($page_title).'</h4>'; + print '<h4 class="pagetitle">'.mb_strtolower($page_title).'</h4>'; } if ($GLOBALS["require_login"] && $page != "login") { @@ -589,7 +589,7 @@ $par = substr($clinearg,1,1); $clinearg = substr($clinearg,2,strlen($clinearg)); # $res[$par] = ""; - $cur = strtolower($par); + $cur = mb_strtolower($par); $res[$cur] .= $clinearg; } elseif ($cur) { if ($res[$cur]) |
|
connect.php.patch (1,073 bytes)
--- connect.php 2014-04-15 00:11:27.000000000 +0200 +++ connect.php.new 2014-06-04 12:10:55.088751687 +0200 @@ -734,7 +734,7 @@ $spb = '<li class="shade0">'; # $spb = '<li class="shade2">'; $spe = '</li>'; - $nm = strtolower(NAME); + $nm = mb_strtolower(NAME); if ($nm != "phplist") { $GLOBALS["context_menu"]["community"] = ""; } @@ -1075,7 +1075,7 @@ return '<!-- '.$desc.'-->'; elseif ($name == "processbounces" && !MANUALLY_PROCESS_BOUNCES) return '<!-- ' . $desc . '-->'; else - return sprintf('<a href="./?page=%s%s" target="phplistwindow">%s</a>',$name,$url,strtolower($desc)); + return sprintf('<a href="./?page=%s%s" target="phplistwindow">%s</a>',$name,$url,mb_strtolower($desc)); } else return "\n<!--$name disabled $access -->\n"; # return "\n$name disabled $access\n"; @@ -1259,7 +1259,7 @@ function phpcfgsize2bytes($val) { $val = trim($val); - $last = strtolower($val{strlen($val)-1}); + $last = mb_strtolower($val{strlen($val)-1}); switch($last) { case 'g': $val *= 1024; |
|
commonlib_lib_interfacelib.php.patch (3,086 bytes)
--- commonlib/lib/interfacelib.php 2013-05-10 17:52:44.000000000 +0200 +++ commonlib/lib/interfacelib.php.new 2014-06-03 23:57:43.000000000 +0200 @@ -173,7 +173,7 @@ $this->addElement($name); $this->addColumn($name,"value", sprintf('<input type="text" name="%s" value="%s" size="40" class="listinginput" />', - strtolower($name),$value)); + mb_strtolower($name),$value)); } function addButton($name,$url) { @@ -203,7 +203,7 @@ $tophelp = $this->help; } $html = '<tr valign="top">'; - $html .= sprintf('<th><a name="%s"></a><div class="listinghdname">%s%s</div></th>',str_replace(" ","_",htmlspecialchars(strtolower($this->title))),$tophelp,$this->title); + $html .= sprintf('<th><a name="%s"></a><div class="listinghdname">%s%s</div></th>',str_replace(" ","_",htmlspecialchars(mb_strtolower($this->title))),$tophelp,$this->title); $c = 1; foreach ($this->columns as $column => $columnname) { if ($c == sizeof($this->columns)) { @@ -465,7 +465,7 @@ $tophelp = $this->help; } $html = '<tr valign="top">'; - $html .= sprintf('<th><a name="%s"></a><div class="listinghdname">%s%s</div></th>',str_replace(" ","_",htmlspecialchars(strtolower($this->title))),$tophelp,$this->title); + $html .= sprintf('<th><a name="%s"></a><div class="listinghdname">%s%s</div></th>',str_replace(" ","_",htmlspecialchars(mb_strtolower($this->title))),$tophelp,$this->title); $c = 1; foreach ($this->columns as $column => $columnname) { if ($c == sizeof($this->columns)) { @@ -653,13 +653,13 @@ <ul class="domtabs"> '; foreach ($this->tabs as $title => $content) { - $html .= sprintf('<li><a href="#%s" title="%s">%s</a></li>',$this->domtabcluster.urlencode(strtolower($title)),htmlspecialchars($title),$title); + $html .= sprintf('<li><a href="#%s" title="%s">%s</a></li>',$this->domtabcluster.urlencode(mb_strtolower($title)),htmlspecialchars($title),$title); } $html .= '</ul>'; foreach ($this->tabs as $title => $content) { $html .= '<div style="display: none;">'; - $html .= sprintf('<h4><a name="%s" id="%s"><span class="hide">%s</span></a></h4>',$this->domtabcluster.strtolower($title),$this->domtabcluster.urlencode(strtolower($title)),$title); + $html .= sprintf('<h4><a name="%s" id="%s"><span class="hide">%s</span></a></h4>',$this->domtabcluster.mb_strtolower($title),$this->domtabcluster.urlencode(strtolower($title)),$title); $html .= $content; $html .= '</div>'; } @@ -861,7 +861,7 @@ } function setCurrent($name) { - $this->current = strtolower($name); + $this->current = mb_strtolower($name); } function previousLink() { @@ -925,7 +925,7 @@ $count = 0; foreach ($this->tabs as $tab => $url) { $count++; - if (strtolower(strip_tags($tab)) == $this->current) { + if (mb_strtolower(strip_tags($tab)) == $this->current) { $this->previous = $previous; $gotcurrent = true; $html .= '<li class="current" id="'.$count.'">'; |
|
|
|
I cannot replicate that on my system. Although there does seem to be something weird with the translations all being "update translation". But the UTF8 encoding is fine. Could it be caused by something else? |
|
Ok, I think what could be a problem that is not replicated on your system. Could you check http://pl1.php.net/manual/en/mbstring.overload.php in your php.ini? On my system there is: mbstring.func_overload = 0 But I think better solution is to apply my patches - on some systems it could not be able to set above variable mbstring.func_overload. What do you think? |
|
php -i |grep overload mbstring.func_overload => 0 => 0 xdebug.overload_var_dump => On => On Can you give me a screenshot of the error? Any chance to provide the patches as Merge Requests on Github? |
|
|
|
Screenshot uploaded. And how to apply patches? Sorry, but I can not understand your question... |
|
ok, will try to look into it. Github is here: https://github.com/michield/phplist The way it works is to clone the code and then push the changes as "Merge Requests" |
|
OK, I've sepnt some time to merge changes, but I failed :-((( Maybe because I'm not familiar with git - I'm not using it. Do you have any quick step-by-step instructions? |
|
I can help write this - M if you can do a very basic guide I will elaborate and perhaps wtps0n could take screenshots for us? Would be a good little blog article :) |
|
well, to contribute via github, you need to do the following (off the top of my head) 1. register with github 2. Fork the phpList code: https://github.com/michield/phplist (and click fork at the top right). 3. Clone your repository to your machine. (on Linux type "git clone https://github.com/[your github acct]/phplist.git") You do the above once, and then you're set up to work on it. Use the docs to set yourself up to run phpList from the code you just checked out Then you use the git workflow to push changes to your own repository: https://help.github.com/categories/54/articles https://help.github.com/categories/19/articles And when you have a change that you think will improve the way phpList works, you create a Merge Request on Github. That will automatically create an issue in the issue tracker. It may be useful to set up a sandbox for this, |
|
Thanks a lot for your quick setup. I've made a new issue, and hope that it will be added to master repository. |
|
https://github.com/michield/phplist/pull/27 |