Skip to content

Commit

Permalink
Fixed issue #7923: INSERTANS SPAN problem in end URL when using then …
Browse files Browse the repository at this point in the history
…all-in-one page presentation setting
  • Loading branch information
c-schmitz committed Jul 30, 2013
1 parent 6e06c1b commit acfde37
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion application/helpers/SurveyRuntimeHelper.php
Expand Up @@ -368,7 +368,7 @@ function run($surveyid,$args) {
//Before doing the "templatereplace()" function, check the $thissurvey['url']
//field for limereplace stuff, and do transformations!
$thissurvey['surveyls_url'] = passthruReplace($thissurvey['surveyls_url'], $thissurvey);
$thissurvey['surveyls_url'] = templatereplace($thissurvey['surveyls_url'], array(), $redata); // to do INSERTANS substitutions
$thissurvey['surveyls_url'] = templatereplace($thissurvey['surveyls_url'], array(), $redata, 'Unspecified', false, NULL, array(), true ); // to do INSERTANS substitutions

//END PAGE - COMMIT CHANGES TO DATABASE
if ($thissurvey['active'] != "Y") //If survey is not active, don't really commit
Expand Down
12 changes: 7 additions & 5 deletions application/helpers/replacements_helper.php
Expand Up @@ -10,7 +10,7 @@
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*
* $Id$
* $Id$
*/
/**
* This function replaces keywords in a text and is mainly intended for templates
Expand All @@ -23,9 +23,10 @@
* @param mixed $replacements Array of replacements: Array( <stringtosearch>=><stringtoreplacewith>
* @param boolean $anonymized Determines if token data is being used or just replaced with blanks
* @param questionNum - needed to support dynamic JavaScript-based tailoring within questions
* @param bStaticReplacement - Default off, forces non-dynamic replacements without <SPAN> tags (e.g. for the Completed page)
* @return string Text with replaced strings
*/
function templatereplace($line, $replacements = array(), &$redata = array(), $debugSrc = 'Unspecified', $anonymized = false, $questionNum = NULL, $registerdata = array())
function templatereplace($line, $replacements = array(), &$redata = array(), $debugSrc = 'Unspecified', $anonymized = false, $questionNum = NULL, $registerdata = array(), $bStaticReplacement = false)
{
/*
global $clienttoken,$token,$sitename,$move,$showxquestions,$showqnumcode,$questioncode;
Expand Down Expand Up @@ -788,7 +789,7 @@ function templatereplace($line, $replacements = array(), &$redata = array(), $de

// Set the array of replacement variables here - don't include curly braces
$coreReplacements = array();
$coreReplacements['ACTIVE'] = (isset($thissurvey['active']) && !($thissurvey['active'] != "Y"));
$coreReplacements['ACTIVE'] = (isset($thissurvey['active']) && !($thissurvey['active'] != "Y"));
$coreReplacements['AID'] = isset($questiondetails['aid']) ? $questiondetails['aid'] : '';
$coreReplacements['ANSWER'] = isset($answer) ? $answer : ''; // global
$coreReplacements['ANSWERSCLEARED'] = $clang->gT("Answers cleared");
Expand All @@ -800,7 +801,7 @@ function templatereplace($line, $replacements = array(), &$redata = array(), $de
$coreReplacements['CLOSEWINDOW'] = "<a href='javascript:%20self.close()'>".$clang->gT("Close this window")."</a>";
$coreReplacements['COMPLETED'] = isset($redata['completed']) ? $redata['completed'] : ''; // global
$coreReplacements['DATESTAMP'] = $_datestamp;
$coreReplacements['ENDTEXT'] = $_endtext;
$coreReplacements['ENDTEXT'] = $_endtext;
$coreReplacements['EXPIRY'] = $_dateoutput;
$coreReplacements['GID'] = isset($questiondetails['gid']) ? $questiondetails['gid']: '';
$coreReplacements['GOOGLE_ANALYTICS_API_KEY'] = $_googleAnalyticsAPIKey;
Expand Down Expand Up @@ -880,7 +881,8 @@ function templatereplace($line, $replacements = array(), &$redata = array(), $de
}

// Now do all of the replacements - In rare cases, need to do 3 deep recursion, that that is default
$line = LimeExpressionManager::ProcessString($line, $questionNum, $doTheseReplacements, false, 3, 1);
$line = LimeExpressionManager::ProcessString($line, $questionNum, $doTheseReplacements, false, 3, 1, false, true, $bStaticReplacement);

return $line;

}
Expand Down

0 comments on commit acfde37

Please sign in to comment.