View Issue Details

IDProjectCategoryView StatusLast Update
0017210phplist applicationInterface - Administratorpublic11-06-14 09:16
Reporterwtps0n 
PrioritynormalSeveritytrivialReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.0.6 
Target Version3.0.7Fixed in Version3.0.7 
Summary0017210: There is question marks instead of polish/hungarian special chars
DescriptionWhen 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 ReproduceInstall 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 :-))
TagsNo tags attached.

Activities

wtps0n

04-06-14 12:33

reporter  

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])
index.php.patch (627 bytes)

wtps0n

04-06-14 12:33

reporter  

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;
connect.php.patch (1,073 bytes)

wtps0n

04-06-14 12:34

reporter  

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.'">';

michiel

04-06-14 17:43

manager  

polish.png (35,037 bytes)
polish.png (35,037 bytes)

michiel

04-06-14 17:44

manager   ~0053866


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?

wtps0n

04-06-14 21:23

reporter   ~0053870

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?

michiel

04-06-14 21:30

manager   ~0053871

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?

wtps0n

05-06-14 17:29

reporter  

phplist-pl.png (32,682 bytes)
phplist-pl.png (32,682 bytes)

wtps0n

05-06-14 17:32

reporter   ~0053876

Screenshot uploaded.

And how to apply patches? Sorry, but I can not understand your question...

michiel

05-06-14 22:11

manager   ~0053878

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"

wtps0n

09-06-14 13:37

reporter   ~0053886

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?

gingerling

09-06-14 15:06

manager   ~0053888

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 :)

michiel

10-06-14 12:31

manager   ~0053901

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,

wtps0n

10-06-14 13:34

reporter   ~0053902

Thanks a lot for your quick setup. I've made a new issue, and hope that it will be added to master repository.

michiel

11-06-14 09:16

manager   ~0053915

https://github.com/michield/phplist/pull/27