Permalink
Browse files

BUGFIX ComplexTableField - fixed sprintf() not enough arguments when …

…the referrer has a % character in it, the referrer is now an argument instead of being hardcoded in the string (from r95093)

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

0 comments on commit b52e49d

Please sign in to comment.