Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Item13188: unit test fixes; correct expansion of json data
  • Loading branch information
Comment committed Feb 11, 2015
1 parent 628f522 commit 6de64f1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions SubscribePlugin/lib/Foswiki/Plugins/SubscribePlugin.pm
Expand Up @@ -128,6 +128,7 @@ sub _SUBSCRIBE {
}
)
);
$tmpl =~ s/\%JSON_DATA\%/$data/g;

# Add nonce, required for Foswiki < 1.2
$tmpl =~ s/\%NONCE\%/_getNonce($session)/ge;
Expand Down
7 changes: 4 additions & 3 deletions SubscribePlugin/templates/subscribe.tmpl
@@ -1,14 +1,15 @@
%{----------------------------------------
Link for a "subscribe" request. Note that REST parameters are encoded in
data-subscribe
}%%TMPL:DEF{sp:subscribe}%
<a class="subscribe_link" data-subscribe="{validation_key:'%NONCE%'}" rel="nofollow" title="%MAKETEXT{"Subscribe to this topic"}%" href="$url">%MAKETEXT{"Subscribe"}%</a>
}%
%TMPL:DEF{sp:subscribe}%
<a class="subscribe_link" data-subscribe="%JSON_DATA%" rel="nofollow" title="%MAKETEXT{"Subscribe to this topic"}%" href="$url">%MAKETEXT{"Subscribe"}%</a>
%TMPL:END%
%{----------------------------------------
Link for an "unsubscribe" request. Note that REST parameters are encoded in
data-subscribe
}%%TMPL:DEF{sp:unsubscribe}%
<a class="subscribe_link" data-subscribe="{validation_key:'%NONCE%'}" rel="nofollow" title="%MAKETEXT{"Unsubscribe from this topic"}%" href="$url">%MAKETEXT{"Unsubscribe"}%</a>
<a class="subscribe_link" data-subscribe="%JSON_DATA%" rel="nofollow" title="%MAKETEXT{"Unsubscribe from this topic"}%" href="$url">%MAKETEXT{"Unsubscribe"}%</a>
%TMPL:END%
%{----------------------------------------
Error message
Expand Down

0 comments on commit 6de64f1

Please sign in to comment.