You are here: Foswiki>Tasks Web>Item10750 (17 Dec 2011, GeorgeClark)Edit Attach

Item10750: BaseUserMapping cUIDs are mangled in a way that crashes UTF-8 Foswiki's with "Malformed UTF-8 character"

pencil
Priority: Urgent
Current State: Closed
Released In: 1.1.4
Target Release: patch
Applies To: Engine
Component:
Branches:
Reported By: PaulHarvey
Waiting For:
Last Change By: GeorgeClark
I have a Foswiki configured with {Site}{CharSet} = 'utf-8';.

This code in Render.pm:
            use bytes;
            $user =~ s/_([0-9a-f][0-9a-f])/chr(hex($1))/ge;
            no bytes;

Causes massive amounts of hellfire in my error logs, and some pages that refuse to reunder (Error 500: "Malformed UTF-8 character (unexpected continuation byte 0x99...)

On any topic that doesn't have a TOPICINFO (so most of those in System). Example: ReleaseNotes01x01 - has no TOPICINFO - and the $info->{author} turns out to be BaseUserMapping_666. However, the code above transforms the 666 into \x66, 6 - mangling the name, and crashing Foswiki if there's any regex applied to the result (Eg. Foswiki::Attrs can't even process a macro argument containing an $wikiusername from SEARCH).

Thanks to CrawfordCurrie, Sven & Olivier for an initial analysis on IRC...

-- PaulHarvey - 17 May 2011

The work-around as Crawford suggested is to enable {RenderLoggedInButUnknownUsers} in LocalSite.cfg

-- PaulHarvey - 17 May 2011

crashes when you got to a WebChanges that contains a topic like that.

-- SvenDowideit - 07 Jun 2011

I've fixed it in Render.pm, but really, creating a 'display value default' should not be in Render.pm, but in the Mapper code.

but then again, the mangle/de-mangle is terrible wherever we put it - if a custom mapper does it differently, and then is uninstalled, we lose again

ok, so i have to think again - but the commit should still stop crashyness

better fix applied later.

-- SvenDowideit - 07 Jun 2011

Thankyou!

-- PaulHarvey - 07 Jun 2011
 

ItemTemplate edit

Summary BaseUserMapping cUIDs are mangled in a way that crashes UTF-8 Foswiki's with "Malformed UTF-8 character"
ReportedBy PaulHarvey
Codebase 1.1.3, trunk
SVN Range
AppliesTo Engine
Component
Priority Urgent
CurrentState Closed
WaitingFor
Checkins distro:877a543e7807 distro:2575b4c0bd06 distro:30ddb9dd7247 distro:8c767f28be0e
TargetRelease patch
ReleasedIn 1.1.4
CheckinsOnBranches
trunkCheckins
Release01x01Checkins
Topic revision: r11 - 17 Dec 2011, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy