View Issue Details

IDProjectCategoryView StatusLast Update
0000232WackoWikiuploadpublic2009-08-19 09:38
Reporterdvg_lab Assigned Toadministrator  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Target Version4.3.rcFixed in Version4.3.rc 
Summary0000232: file upload description: russian chars incorrectly inserting to a database
Descriptionthe bug in handlers/page/upload.php

if you write russian description it inserts some buggy chars into a page

here is the patch in attached file.
TagsNo tags attached.
Attached Files
patch.txt (554 bytes)   
--- upload.php.orig	2008-10-01 17:19:46.000000000 +0400
+++ upload.php	2008-10-01 17:19:59.000000000 +0400
@@ -183,7 +183,7 @@
 					// Make HTML in the description redundant ;�)
 					$description = $this->Format($description, "preformat");
 					$description = $this->Format($description, "safehtml");
-					$description = htmlentities($description);
+					$description = htmlentities($description,ENT_COMPAT,$this->GetCharset());
 
 					// 5. insert line into DB
 					$this->Query("insert into ".$this->config["table_prefix"]."upload set ".
patch.txt (554 bytes)   

Activities

administrator

2008-10-01 15:22

administrator   ~0000518

Last edited: 2008-10-09 17:25

ToDo: Check if this is the only place where this issue occurs.

administrator

2008-10-01 18:11

administrator   ~0000519

@ dvg_lab
can you provide an example we can use for testing

dvg_lab

2008-10-08 11:34

updater   ~0000520

sorry, I can't show it on my wiki installation, but the function htmlentities() uses wrong charset by default (it seemed to me it wrong when charset is not latin or standart ISO), I think in any case using current charset as $this->GetCharset() looks good for other languages too.

AFAIK htmlentities() tries to identify right charset automatically, but does it not so good.

my environment:
MySQL DB charset: cp1251, cp1251_general_ci
wiki charset: cp1251
russian comment: русский комментарий

administrator

2008-10-08 15:57

administrator   ~0000521

Last edited: 2008-10-09 16:31

I could reproduce the error and tested the patch successfully. Thanks.
It is still a mess if you change only one language setting, we need UTF-8 a.s.a.p.

FIXED and SVNed with revision 167

Issue History

Date Modified Username Field Change
2008-10-01 14:53 dvg_lab New Issue
2008-10-01 14:53 dvg_lab File Added: patch
2008-10-01 14:53 dvg_lab Legacy => NEW
2008-10-01 15:17 administrator Status new => acknowledged
2008-10-01 15:17 administrator Target Version => 5.0.0
2008-10-01 15:22 administrator Note Added: 0000518
2008-10-01 16:04 administrator File Added: patch.txt
2008-10-01 16:05 administrator File Deleted: patch
2008-10-01 18:11 administrator Note Added: 0000519
2008-10-01 18:12 administrator Note Edited: 0000518
2008-10-08 11:34 dvg_lab Note Added: 0000520
2008-10-08 15:57 administrator Note Added: 0000521
2008-10-08 15:58 administrator Assigned To => administrator
2008-10-08 15:58 administrator Status acknowledged => resolved
2008-10-08 15:58 administrator Resolution open => fixed
2008-10-08 15:58 administrator Product Version 5.0.0 =>
2008-10-08 15:58 administrator Fixed in Version => 5.0.0
2008-10-08 16:10 administrator Summary russian chars incorrectly inserting to a database => file upload description: russian chars incorrectly inserting to a database
2008-10-09 16:31 administrator Note Edited: 0000521
2008-10-09 17:25 administrator Note Edited: 0000518
2009-08-19 09:25 administrator Fixed in Version 5.0.0 => 4.3.rc
2009-08-19 09:38 administrator Target Version 5.0.0 => 4.3.rc
2010-03-08 10:23 administrator Category Upload => upload