Permalink
Browse files

BUGFIX Escaping sprintf() arguments in ComplexTableField to avoid ext…

…raneous % characters in a referrer URL messing up the sprintf() invocation

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@93745 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent 389adf2 commit f3db0948748298ebaf7c4abc7db3e9c151d79039 @chillu chillu committed Nov 27, 2009
Showing with 1 addition and 1 deletion.
  1. +1 −1 forms/ComplexTableField.php
@@ -814,7 +814,7 @@ function saveComplexTableField($data, $form, $request) {
$referrer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null;
$closeLink = sprintf(
- '<small><a href="' . $referrer . '" onclick="javascript:window.top.GB_hide(); return false;">(%s)</a></small>',
+ '<small><a href="' . str_replace('%', '%%', $referrer) . '" onclick="javascript:window.top.GB_hide(); return false;">(%s)</a></small>',
_t('ComplexTableField.CLOSEPOPUP', 'Close Popup')
);
$message = sprintf(

0 comments on commit f3db094

Please sign in to comment.