Priority: Urgent
Current State: Closed
Released In: 2.1.8
Target Release: patch
Applies To: Extension
Component: RCSStoreContrib
Branches: Release02x01 master
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.
Hotfix:
diff --git a/RCSStoreContrib/lib/Foswiki/Store/Rcs/Store.pm b/RCSStoreContrib/lib/Foswiki/Store/Rcs/Store.pm
index 153e2859f..f5e061535 100644
--- a/RCSStoreContrib/lib/Foswiki/Store/Rcs/Store.pm
+++ b/RCSStoreContrib/lib/Foswiki/Store/Rcs/Store.pm
@@ -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