View Issue Details

IDProjectCategoryView StatusLast Update
0008888mantisbtlocalizationpublic2020-03-10 17:23
Reportercheater Assigned Todregad  
PrioritynormalSeverityblockReproducibilityalways
Status closedResolutionno change required 
OSWindowsOS VersionXP 
Product Version1.1.1 
Summary0008888: Wrong configuration-result
Description

The function "config_get()" returns a wrong result, if type = "complex" and serialized string contains umlaute.

Solution: Using utf8_decode()

See core/config_api.php, line 128-130
Old:
case CONFIG_TYPE_COMPLEX:
$t_value = unserialize( $t_raw_value );
break;

Fix:
case CONFIG_TYPE_COMPLEX:
$t_value = unserialize( utf8_decode($t_raw_value) );
break;

Steps To Reproduce

serialized string in db:

config_id: status_enum_workflow
value = a:7:{i:10;s:81:"20:Rückmeldung,30:anerkannt,40:bestätigt,50:zugewiesen,80:erledigt,90:geschlossen";i:20;s:73:"10:neu,30:anerkannt,40:bestätigt,50:zugewiesen,80:erledigt,90:geschlossen";i:30;s:75:"10:neu,20:Rückmeldung,40:bestätigt,50:zugewiesen,80:erledigt,90:geschlossen";i:40;s:75:"10:neu,20:Rückmeldung,30:anerkannt,50:zugewiesen,80:erledigt,90:geschlossen";i:50;s:74:"10:neu,20:Rückmeldung,30:anerkannt,40:bestätigt,80:erledigt,90:geschlossen";i:80;s:76:"10:neu,20:Rückmeldung,30:anerkannt,40:bestätigt,50:zugewiesen,90:geschlossen";i:90;s:73:"10:neu,20:Rückmeldung,30:anerkannt,40:bestätigt,50:zugewiesen,80:erledigt";}

Changing status by using actiongroup results bug_actiongroup_status-error

TagsNo tags attached.

Activities

vboctor

vboctor

2008-02-21 04:28

manager   ~0017137

I've confirmed this fix. It should be applied to both core/config_api.php and adm_config_report.php.

bitplus

bitplus

2008-11-06 19:06

reporter   ~0019793

Unserialize with utf8 content will get trouble. To fix it, try the code below:

case CONFIG_TYPE_COMPLEX:
$t_raw_value = preg_replace('!s:(\d+):"(.*?)";!se', "'s:'.strlen('$2').':\"$2\";'", $t_raw_value );
$t_value = unserialize( $t_raw_value );
break;

vboctor

vboctor

2008-11-06 21:06

manager   ~0019794

@bitplus, can you please explain your suggested fix.

bitplus

bitplus

2008-11-07 09:12

reporter   ~0019800

Sorry, vboctor, I don't know the detail of this solution. Maybe it is a bug of PHP. I learned from the user contributed notes of php user manual http://www.php.net/manual/en/function.unserialize.php#84730. And it works fine for me.

siebrand

siebrand

2009-07-06 19:07

developer   ~0022430

Paul, please check this. May have been fixed with all the UTF-8 work you've been doing for 1.2.

stevecharon

stevecharon

2009-07-16 04:55

reporter   ~0022515

This problem is only there because the configuration is saved in the current admins language.
If you change this to save it in english and translate using lang_get like everywhere else the problem is gone.

Each time I have to change my config I do this with an admin account that has english as language set.
@bitplus your solution wont work for me. Neither in adm_config_report nor in config_api.php

dregad

dregad

2020-02-25 11:09

developer   ~0063689

We are resolving this issue as "no change required", because it was reported against an old version of MantisBT which is no longer supported.

We recommend that you upgrade to the latest stable version [1]; if after doing so the problem still exists, do not hesitate to reopen the issue.

[1] http://www.mantisbt.org/download.php