Permalink
Browse files

Item14150: Merge branch 'master' into Item13897

  • Loading branch information...
2 parents a33e0ff + c47158a commit 85621e2b88590668eab727eacbe35f9b31a47664 @gac410 gac410 committed Sep 1, 2016
Showing with 17 additions and 0 deletions.
  1. +8 −0 core/lib/Foswiki/PageCache.pm
  2. +9 −0 core/lib/Foswiki/Validation.pm
@@ -696,6 +696,14 @@ sub _handleDirtyArea {
$prefs->popTopicContext();
};
+ my $request = $app->request;
+ my $context = $request->url( -full => 1, -path => 1, -query => 1 ) . time();
+ my $cgis = $app->users->getCGISession;
+ my $usingStrikeOne = $Foswiki::cfg{Validation}{Method} eq 'strikeone';
+
+ $text =~
+s/<input type='hidden' name='validation_key' value='(\?.*?)' \/>/Foswiki::Validation::updateValidationKey($cgis, $context, $usingStrikeOne, $1)/gei;
+
#Foswiki::Func::writeDebug("out text='$text'") if TRACE;
return $text;
}
@@ -92,6 +92,15 @@ sub addValidationKey {
return "<input type='hidden' name='validation_key' value='?$nonce' />";
}
+sub updateValidationKey {
+ my ( $cgis, $context, $strikeone, $oldKey ) = @_;
+
+ # expire old key
+ expireValidationKeys( $cgis, $oldKey );
+
+ return addValidationKey( $cgis, $context, $strikeone );
+}
+
=begin TML
---++ StaticMethod generateValidationKey( $cgis, $context, $strikeone ) -> $nonce

0 comments on commit 85621e2

Please sign in to comment.