You are here: Foswiki>Tasks Web>Item15076 (31 Mar 2022, MichaelDaum)Edit Attach

Item15076: RCS store does not properly encode topic information

Priority: Urgent
Current State: Waiting for Release
Released In: 2.1.8
Target Release: patch
Applies To: Extension
Component: RCSStoreContrib
Branches: Release02x01 master
Reported By: MichaelDaum
Waiting For:
Last Change By: MichaelDaum
There are two ways history is written into the store: saveTopic() and repRev(). While both encoded the topic text and the comment during save, repRev() does not encode the cUID value properly. It does so during saveTopic not so during repRev(). This leads to the topic being downgraded from utf8 to latin1 during save as perl's attempt to resolve the broken mixed encoding on its way to the disk.


diff --git a/RCSStoreContrib/lib/Foswiki/Store/Rcs/ b/RCSStoreContrib/lib/Foswiki/Store/Rcs/
index 153e2859f..f5e061535 100644
--- a/RCSStoreContrib/lib/Foswiki/Store/Rcs/
+++ b/RCSStoreContrib/lib/Foswiki/Store/Rcs/
@@ -458,6 +458,7 @@ sub repRev {
     my $handler = $this->getHandler( $topicObject->web, $topicObject->topic );
     my $text    = Foswiki::Serialise::serialise( $topicObject, 'Embedded' );
     $text = _encode($text);
+    $cUID = _encode($cUID);
     $handler->replaceRevision( $text, 'reprev', $cUID,
         defined $options{forcedate} ? $options{forcedate} : $info->{date} );

-- MichaelDaum - 31 Mar 2022

Topic revision: r1 - 31 Mar 2022, MichaelDaum
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